Using the dataLabels value in the IlvSwingTableDataSource as the labels of the X axis

Article ID: 2360
Last updated: 30 May, 2018
Article ID: 2360
Last updated: 30 May, 2018
Revision: 3
Views: 712
Posted: 08 Jul, 2010
by Dean J.
Updated: 30 May, 2018
by Gargani A.

Question

How to use the dataLabels value in the IlvSwingTableDataSource as the labels of the X axis?

Answer

The IlvSwingTableDataSource makes its 'dataLabels' column available through the getDataLabel(index) method of the

datasets that it creates and provides.

The result of the getDataLabel() is being used in the following scenarios:

  • As X axis label in 'category' mode
  • As legend text for PIE charts
  • For data labels inside the plot area, if the renderer's labeling mode isset to DATA_LABEL
  • In CSS rules for 'point', when you access the 'label' property

There are three options to get the dataLabel values to display on the X axis:

  1. Use a Chart in "category" mode
  2. Override the IlvScale.computeLabel method to perform a dataset lookup
  3. Provide a custom IlvValueFormat as the X scale's label format to perform a dataset lookup

The attached sample illustrates the implementation of option 3 (using a custom IlvValueFormat) to display the dataLabels of the

IlvSwingTableDataSource on the X axis.

Note: the predefined IlvCategoryStepsDefinition expects the

value to be numbers. If you have dates in the X values, it is recommended that

you select either option 2 or 3 to display the dataLabels values

on the X axis.

This article was:   Helpful | Not helpful
Report an issue
Article ID: 2360
Last updated: 30 May, 2018
Revision: 3
Views: 712
Posted: 08 Jul, 2010 by Dean J.
Updated: 30 May, 2018 by Gargani A.
Attached files

Also listed in


Others in this category