1

I include

"dojox/charting/action2d/Tooltip" ...

... function(ready, Chart, Spider, Tooltip, Base){

I have the tooltip set up, if I do something basic like return('test'), that shows properly.

var tip = new Tooltip(chart, "default",
            {
                text : function(o) {

                }
            });

I add my series like so:

chart.addSeries("min", {data: data[0] }, { fill: "blue" });
chart.addSeries("max", {data: data[1] }, { fill: "blue" });
chart.addSeries("Answered", {data: data[2] }, { fill: "#37B549" });

How do I access the charts data?

Right now tooltips by default show:

Question 1 //series
test1
10 //Axis point

I only want tooltips to say [10 out of [max]]

I tried using o.tdata.data to get the point(10), but that threw a lot of errors.

Any thoughts?

4

1 回答 1

1

您可以在系列数据集中指定自定义工具提示。喜欢:

mychart.addSeries("line_series", 
               [{y:1,x:1,tooltip: "bar 1"}, 
                {y: 3,x:2,tooltip: "bar 2"}, 
                {y:5,x:3,tooltip: "bar 3"}], 
                {plot: "line_plot"});

看到这个小提琴:

http://jsfiddle.net/goinoff/5VYhN/2/

于 2013-05-08T17:57:29.840 回答