3.4.1 Adding Tooltips to a Table or Chart
To specify tooltips for individual table cells or chart data, use the following syntax:
replet.addStatus("ElementID", item, "Tooltip");
The 'item' parameter specifies the particular table cell or chart data that should display the tooltip. The 'item' parameter is an EventPoint object, [column, row].
For example, consider the following element-level script for a chart with ID 'Chart1'. Note the index order in the 'item' parameter.
for(var i = 1; i < data.length; i++) {
replet.addStatus("Chart1", [1,i-1], data[i][1]);
}
The loop iterates through every value in the first chart dataset (index '1'), given by “data[i][1],” and assigns each value to the tooltip of the corresponding chart graphical element. Use “data[i][0]” to obtain the X-labels.
To perform a similar assignment of tooltips to individual cells in a table (ID 'Table1'), you can use the following script. Again, note the index order.
for(var i = 1; i < table.length; i++) {
for(var j = 0; j < table.size; j++) {
replet.addStatus("Table1",[j,i],table[i][j]);
}
}
To add a single tooltip to an entire table or chart element, leave the 'item' parameter as 'undefined' or 'null':
replet.addStatus("Table1",null,"Example table");
replet.addStatus("Chart1",null,"Example chart");
See Also
toolTip, for a more straightforward approach to Chart tooltips.
| << 3.4 Adding Tooltips to Elements | © 1996-2013 InetSoft Technology Corporation (v11.5) | 3.4.2 Specifying a Data Format for Tooltip Text >> |