diff --git a/src/amchart/Area.js b/src/amchart/Area.js index 04361fb6f0..d27dfb5507 100644 --- a/src/amchart/Area.js +++ b/src/amchart/Area.js @@ -19,8 +19,6 @@ Area.prototype.publish("paletteID", "default", "set", "Palette ID", Area.prototype._palette.switch(),{tags:["Basic","Shared"]}); Area.prototype.publish("isStacked", false, "boolean", "Stack Chart",null,{tags:["Basic","Shared"]}); Area.prototype.publish("fillOpacity", 0.7, "number", "Opacity of The Fill Color", null, {min:0,max:1,step:0.001,inputType:"range",tags:["Intermediate","Shared"]}); - - Area.prototype.publish("tooltipTemplate","[[category]]: [[value]]", "string", "Tooltip Text",null,{tags:["Intermediate"]}); Area.prototype.publish("stackType", "regular", "set", "Stack Type",["none","regular","100%"],{tags:["Basic"]}); Area.prototype.enter = function(domNode, element) { diff --git a/src/amchart/Bar.js b/src/amchart/Bar.js index b9dfdc6ecc..f56c372b13 100644 --- a/src/amchart/Bar.js +++ b/src/amchart/Bar.js @@ -32,8 +32,6 @@ Bar.prototype.publish("stackType", "regular", "set", "Stack Type",["none","regular","100%"],{tags:["Basic"]}); - Bar.prototype.publish("tooltipTemplate","[[category]]([[title]]): [[value]]", "string", "Tooltip Text",null,{tags:["Intermediate"]}); - Bar.prototype.enter = function(domNode, element) { CommonSerial.prototype.enter.apply(this, arguments); }; diff --git a/src/amchart/Bubble.js b/src/amchart/Bubble.js index fbad44814c..e2d2e1231a 100644 --- a/src/amchart/Bubble.js +++ b/src/amchart/Bubble.js @@ -19,7 +19,6 @@ Bubble.prototype.implements(INDChart.prototype); Bubble.prototype.publish("paletteID", "default", "set", "Palette ID", Bubble.prototype._palette.switch(), {tags:["Basic","Shared"]}); - Bubble.prototype.publish("tooltipTemplate","x:[[x]] y:[[y]]", "string", "Tooltip Text"); Bubble.prototype.enter = function(domNode, element) { CommonXY.prototype.enter.apply(this, arguments); diff --git a/src/amchart/Candle.js b/src/amchart/Candle.js index a93ba0d292..da19d8be4d 100644 --- a/src/amchart/Candle.js +++ b/src/amchart/Candle.js @@ -22,8 +22,6 @@ Candle.prototype.publish("paletteGrouping", "By Column", "set", "Palette Grouping",["By Category","By Column"],{tags:["Basic"]}); - Candle.prototype.publish("tooltipTemplate",'
[[category]]
Open:[[open]] Close:[[close]]
Low:[[low]] High:[[high]]
', "string", "Tooltip Text",null,{tags:["Intermediate"]}); - Candle.prototype.publish("columnWidth", 0.62, "number", "Bar Width",null,{tags:["Basic"]}); Candle.prototype.publish("stackType", "regular", "set", "Stack Type",["none","regular","100%"],{tags:["Basic"]}); diff --git a/src/amchart/CommonRadar.js b/src/amchart/CommonRadar.js index 014f350a0b..7ef2d2644b 100644 --- a/src/amchart/CommonRadar.js +++ b/src/amchart/CommonRadar.js @@ -133,7 +133,10 @@ var context = this; var gObj = {}; - gObj.balloonText = context.tooltipTemplate(); + gObj.balloonFunction = function(d) { + var balloonText = d.category + ", " + context.columns()[d.graph.index+1] + ": " + context.data()[d.index][d.graph.columnIndex+1]; + return balloonText; + }; gObj.fillAlphas = context.fillOpacity(); gObj.lineAlpha = context.lineOpacity(); gObj.lineThickness = context.lineWidth(); diff --git a/src/amchart/CommonSerial.js b/src/amchart/CommonSerial.js index 76393faff7..3ba1f1ddb0 100644 --- a/src/amchart/CommonSerial.js +++ b/src/amchart/CommonSerial.js @@ -14,6 +14,7 @@ this._chart = {}; } CommonSerial.prototype = Object.create(HTMLWidget.prototype); + CommonSerial.prototype.constructor = CommonSerial; CommonSerial.prototype._class += " amchart_CommonSerial"; @@ -163,7 +164,10 @@ var context = this; var gObj = {}; - gObj.balloonText = context.tooltipTemplate(); + gObj.balloonFunction = function(d) { + var balloonText = d.category + ", " + context.columns()[d.graph.columnIndex+1] + ": " + context.data()[d.index][d.graph.columnIndex+1]; + return balloonText; + }; gObj.lineAlpha = context.lineOpacity(); gObj.lineColor = context.lineColor(); gObj.lineThickness = context.lineWidth(); @@ -241,6 +245,9 @@ this._chart.addListener("clickGraphItem", function(e) { context.click(context.rowToObj(context._data[e.index]), context._columns[e.target.columnIndex+1]); }); + this._chart.addListener("rollOverGraphItem", function(e) { + context.tooltipShow(context.rowToObj(context._data[e.index]), context._columns, e.target.columnIndex+1); + }); }; CommonSerial.prototype.update = function(domNode, element) { diff --git a/src/amchart/CommonXY.js b/src/amchart/CommonXY.js index 5af5018a5b..7fa3b23be2 100644 --- a/src/amchart/CommonXY.js +++ b/src/amchart/CommonXY.js @@ -154,7 +154,10 @@ var context = this; var gObj = {}; - gObj.balloonText = context.tooltipTemplate(); + gObj.balloonFunction = function(d) { + var balloonText = context.columns()[d.graph.columnIndex+1] + ": " + context.data()[d.index][d.graph.columnIndex+1]; + return balloonText; + }; gObj.lineAlpha = context.lineOpacity(); gObj.lineThickness = context.lineWidth(); gObj.bullet = context.bulletType(); diff --git a/src/amchart/FloatingColumn.js b/src/amchart/FloatingColumn.js index 80423c4358..88d171710b 100644 --- a/src/amchart/FloatingColumn.js +++ b/src/amchart/FloatingColumn.js @@ -29,7 +29,6 @@ FloatingColumn.prototype.publish("Angle3D", 0, "number", "3D Angle (Deg)",null,{tags:["Basic"]}); FloatingColumn.prototype.publish("stackType", "regular", "set", "Stack Type",["none","regular","100%"],{tags:["Basic"]}); - FloatingColumn.prototype.publish("tooltipTemplate","[[category]]([[title]]): [[value]]", "string", "Tooltip Text",null,{tags:["Intermediate"]}); FloatingColumn.prototype.testData = function() { this.columns(["Subject", "open", "close"]); diff --git a/src/amchart/Funnel.js b/src/amchart/Funnel.js index eaff5037ea..b4ce97b83f 100644 --- a/src/amchart/Funnel.js +++ b/src/amchart/Funnel.js @@ -19,9 +19,6 @@ Funnel.prototype.publish("neckHeightPercent", 30, "number", "Neck Height %",null,{tags:["Basic"]}); Funnel.prototype.publish("neckWidthPercent", 40, "number", "Neck Width %",null,{tags:["Basic"]}); - //TODO - Funnel.prototype.publish("tooltipTemplate","[[category]]([[title]]): [[value]]", "string", "Tooltip Text",null,{tags:["Basic"]}); - Funnel.prototype.enter = function(domNode, element) { CommonFunnel.prototype.enter.apply(this, arguments); }; @@ -29,7 +26,10 @@ Funnel.prototype.updateChartOptions = function() { CommonFunnel.prototype.updateChartOptions.apply(this, arguments); - this._chart.balloonText = this.tooltipTemplate(); + this._chart.balloonFunction = function(d) { + var balloonText = d.title + ", " + d.value; + return balloonText; + }; this._chart.neckHeight = this.neckHeightPercent()+"%"; this._chart.neckWidth = this.neckWidthPercent()+"%"; }; diff --git a/src/amchart/Line.js b/src/amchart/Line.js index 4f9988127c..df0d4e0f52 100644 --- a/src/amchart/Line.js +++ b/src/amchart/Line.js @@ -20,7 +20,6 @@ Line.prototype.publish("smoothLines", false, "boolean", "Causes chart data lines to draw smoothly",null,{tags:["Basic","Shared"]}); Line.prototype.publish("stepLines", false, "boolean", "Causes chart data lines to draw smoothly",null,{tags:["Basic"]}); - Line.prototype.publish("tooltipTemplate","[[category]]([[title]]): [[value]]", "string", "Tooltip Text",null,{tags:["Basic"]}); Line.prototype.enter = function(domNode, element) { CommonSerial.prototype.enter.apply(this, arguments); diff --git a/src/amchart/Pie.js b/src/amchart/Pie.js index de36dd4973..bb9565ebc3 100644 --- a/src/amchart/Pie.js +++ b/src/amchart/Pie.js @@ -21,8 +21,6 @@ Pie.prototype.publish("fontSize", 11, "number", "Label Font Size",null,{tags:["Basic","Shared"]}); Pie.prototype.publish("fontColor", null, "html-color", "Label Font Color",null,{tags:["Basic","Shared"]}); - Pie.prototype.publish("tooltipTemplate","[[title]]
[[value]] ([[percents]]%)", "string", "Tooltip Text",null,{tags:["Intermediate"]}); - Pie.prototype.publish("Depth3D", 0, "number", "3D Depth (px)",null,{tags:["Basic"]}); Pie.prototype.publish("Angle3D", 0, "number", "3D Angle (Deg)",null,{tags:["Basic"]}); @@ -43,13 +41,13 @@ Pie.prototype.publish("useClonedPalette", false, "boolean", "Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}); Pie.prototype.updateChartOptions = function() { - var context = this; - this._chart.type = "pie"; this._chart.radius = this.radius(); - this._chart.balloonText = context.tooltipTemplate(); - + this._chart.balloonFunction = function(d) { + var balloonText = d.title + ", " + d.value; + return balloonText; + }; this._chart.labelPosition = this.labelPosition(); if (this.marginLeft()) { this._chart.marginLeft = this.marginLeft(); } @@ -65,6 +63,8 @@ this._chart.fontSize = this.fontSize(); this._chart.color = this.fontColor(); + + this._chart.outlineColor = "#000000"; this._chart.allLabels = []; this._chart.pieAlpha = this.pieAlpha(); diff --git a/src/amchart/Polar.js b/src/amchart/Polar.js index fd1f9e0a6e..04894b4038 100644 --- a/src/amchart/Polar.js +++ b/src/amchart/Polar.js @@ -17,7 +17,6 @@ Polar.prototype.implements(INDChart.prototype); Polar.prototype.publish("paletteID", "default", "set", "Palette ID", Polar.prototype._palette.switch(), {tags:["Basic","Shared"]}); - Polar.prototype.publish("tooltipTemplate","[[category]]([[title]]): [[value]]", "string", "Tooltip Text",null,{tags:["Intermediate"]}); Polar.prototype.testData = function() { this.columns(["Subject", "Year 1", "Year 2", "Year 3", "Year 4"]); diff --git a/src/amchart/Pyramid.js b/src/amchart/Pyramid.js index 5d7975ee3e..ae1e2ded37 100644 --- a/src/amchart/Pyramid.js +++ b/src/amchart/Pyramid.js @@ -17,7 +17,6 @@ Pyramid.prototype.implements(I2DChart.prototype); Pyramid.prototype.publish("paletteID", "default", "set", "Palette ID", Pyramid.prototype._palette.switch(), {tags:["Basic","Shared"]}); - Pyramid.prototype.publish("tooltipTemplate","[[category]]([[title]]): [[value]]", "string", "Tooltip Text",null,{tags:["Intermediate"]}); Pyramid.prototype.testData = function() { this.columns(["Subject", "Year 1"]); diff --git a/src/amchart/Scatter.js b/src/amchart/Scatter.js index 64cae0cce3..e457244264 100644 --- a/src/amchart/Scatter.js +++ b/src/amchart/Scatter.js @@ -19,7 +19,6 @@ Scatter.prototype.implements(INDChart.prototype); Scatter.prototype.publish("paletteID", "default", "set", "Palette ID", Scatter.prototype._palette.switch(), {tags:["Basic","Shared"]}); - Scatter.prototype.publish("tooltipTemplate","x:[[x]] y:[[y]]", "string", "Tooltip Text"); Scatter.prototype.enter = function(domNode, element) { CommonXY.prototype.enter.apply(this, arguments); diff --git a/src/common/HTMLWidget.js b/src/common/HTMLWidget.js index 08b263b3f0..c1429178ab 100644 --- a/src/common/HTMLWidget.js +++ b/src/common/HTMLWidget.js @@ -187,4 +187,4 @@ }; return HTMLWidget; -})); +})); \ No newline at end of file