Custom Tooltip

You can create a custom tooltip that incorporates data values in java.text.MessageFormat format.

To create a custom tooltip, follow the steps below:

1. Right-click the chart, and select 'Properties' from the context menu. This opens the 'Chart Properties' dialog box.

2. Select the Chart tab, and click on the body of the chart.

3. In the 'Plot Properties' panel, press the 'Customize' button next to 'Tooltip'.

 

This opens the 'Customize Tooltip' dialog box.

4. Select the 'Custom' option, and enter the desired tooltip markup into the edit box.

The indices for the available columns are listed at the bottom of the dialog box.

 

To insert data into the tooltip, enter the index of a data column within curly braces, e.g., {1}. Use java.text.MessageFormat format to format the inserted data. For example:

See Formatting for information about for­mat masks.

Date: {0, date, MMM-yy}

Sales: {1, number, $#,###.00}

Example: Custom Tooltip  >>

In this example, you will create a chart that displays quantity purchased by company. When the user hovers the mouse over a given company (e.g., “Rutgers Bank”), the Chart will display a tooltip similar to the following:

Rutgers Bank
27 units purchased

Follow the steps below:

1. Create a new report, and drag a Chart element into the report. Click on the Chart to select it.

2. In the Data panel, expand the 'Global Worksheet' node and the 'Tutorial' node. Expand the 'US Sales' Worksheet.

3. Drag the 'Company' dimension to the 'X' field in the Binding panel.

4. Drag the 'Quantity Purchased' measure to the 'Y' field in the Binding panel. This creates a chart that displays quantity purchased for each company.

5. Click the 'Edit Dimension' button next to the 'Company' field, and select 'Ranking' to display only the top 10 companies. Click the 'Apply' button.

 

6. Right-click the Chart, and select 'Properties' from the context menu. This opens the 'Chart Properties' dialog box.

7. Under the Chart tab, click on the Chart body to display the 'PLot Property' panel.

8. Next to the 'Tooltip' option, press 'Customize' button. This opens the 'Customize Tooltip' dialog box.

9. Select the 'Custom' option and enter the following in the text field:

{0}

{1} units purchased

 

10. Press 'OK' to close the 'Customize Tooltip' dialog box, and press 'OK' again to close the 'Chart Properties' dialog box.

11. Save the report, and then view the report

When you hover the mouse over the bars on the chart, you will now see the custom tooltip you specified.

 

 

See Also

Adding a Non-Displaying Measure to a Chart, to utilize a measure in the tooltip which is not displayed on the chart.

<< Plot Property © 1996-2013 InetSoft Technology Corporation (v11.4) Showing Values on a Chart >>