Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#10895 closed enhancement (fixed)

Enable custom tooltip display on DataPresentation widget

Reported by: Adam Peller Owned by: Adam Peller
Priority: high Milestone: 1.5
Component: Dojox Version: 1.4.0
Keywords: Cc:
Blocked By: Blocking:

Description

The default tooltip display on the chart is just the data series value. For improved accessibility and usability it can be useful to include the name of the data series, and the independent axis value of the data point, as well as the data value. It may also be desirable to format or present the tooltip value neatly. The DataPresentation widget should support a "tooltip" attribute whose value could be a string or a function. If the value is a string, the string will be used as the tooltip for data points. The following substitution tokens can be included in the string:

{0} - the type of chart element ('bar', 'surface', etc) {1} - the name of the data series {2} - the independent axis value at the tooltip data point {3} - the series value at the tooltip data point point

If the value is a function, it will receive a single parameter exactly as per the dojox.charting.action2D.Tooltip class, and will return the tooltip text to be applied. The function will be called for each data point for which tooltip text is required.

Change History (3)

comment:1 Changed 9 years ago by Adam Peller

Resolution: fixed
Status: newclosed

(In [21619]) Enable custom tooltip display on DataPresentation? widget. Patch from Dave Clark (IBM, CCLA) Fixes #10895

comment:2 Changed 9 years ago by Adam Peller

(In [21621]) Patch from Dave Clark (IBM, CCLA) In some circumstances, when label values can be unpredictable lengths for example, it may be advantageous to suppress label display on the independent axis altogether. There is currently an attribute "labelMod" which enables only every 2nd, 3rd, 4th, etc, label to be displayed via labelMod=2, 3, 4, etc. A natural extension would be for labelMod=0 to suppress label display altogether. Refs #10895

comment:3 Changed 9 years ago by Adam Peller

(In [21765]) Patch from Dave Clark (IBM) Ensure correct substitutions are applied in tooltips for sparse labels (labelMod !== 1) Refs #10895

Note: See TracTickets for help on using tickets.