« Return to Thread: Error applying custom tooltips to a bar chart

Re: Error applying custom tooltips to a bar chart

by XMaNIaC :: Rate this Message:

Reply to Author | View in Thread

For those interested. It seems that tooltips are generated in different ways depending on the chart type. For bars I ended up with:

new dojox.charting.action2d.Tooltip(pollgraph${fn:replace(id, ".", "_")}, "default", {
   text: function (o) {
      return "whatever";
   }
});

On Mon, Jun 8, 2009 at 10:35 AM, Jose Noheda <jose.noheda@...> wrote:
I have this code:
chart.addAxis("y", {
  vertical: true,
  minorTicks: false,
  labels: [{text:'a',value: 1},{text:'b',value: 2},{text:'c',value: 3},{text:'d',value: 4},{text:'e',value: 5}]
});
chart.addAxis("x", {
  min: 0,
  max: 2,
  minorTicks: false
});
chart.addSeries('z', [2,1,2,0,1]);
It works perfectly. If I now try to add a custom tootip here modifying the series data
chart.addSeries('z', [{x:2, tooltip:'a'},{x:1, tooltip:'a'},{x:2, tooltip:'a'}..]);
It fails with a JS error. The error disappears when the values of x are all different (say 1,2,3,4,5) but even then no bar is painted. Can anyone spot the problem?

Regards


_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
Dojo-interest@...
http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

 « Return to Thread: Error applying custom tooltips to a bar chart