views:

185

answers:

1

I discovered that the dojox.charting.action2d.Tooltip takes a custom function to provide the text for the labels. The challenge is that the text of the label that I want to display is contained within dojo.data.ItemFileReadStore which the chart series is pointed at. I am trying to figure out some way to tie back the information passed in the object in the function to an item in the store. My understanding is that the notification object can contain the following:

  • event - a raw event object
  • type - can be "onmouseover", "onmouseout", "onclick" or "onplotreset"
  • run - a Series object
  • plot - a Plot2D object
  • index - the numeric index into series
  • element - can be "bar", "column", "circle", "slice", "marker"
  • shape - a dojox.gfx shape object for the element
  • hAxis - a horizontal axis object or null
  • vAxis - a vertical axis object or null
  • x - an x value (on the horizontal axis)
  • y - a y value (on the vertical axis)
  • cx, cy - a center of the marker/circle/slice in geometric coordinates
  • cr - a radius of circle/slice in geometric coordinates

I trued to access run.store, which seemed logical to me, but I get back undefined. y contains the particular value that I am chasing after, but I can't use that to search the ItemFileReadStore because I cannot guarantee that that would be unique. Ideally I am looking for some way of identifying specifically the item in the store that the current notification is being fired for.

+1  A: 

http://docs.dojocampus.org/dojox/charting/ says that default text function looks for a custom tooltip text in 'Tooltip' property of the data point object.
I would try to rename the store's items' property that holds label into 'Tooltip'.

Kniganapolke
Close... It wasn't `Tooltip` it needed to be `tooltip` and then it worked like a charm. But close enough!
Kitson