Adding a Displayer to a Chart
Once a displayer has been created, it should be added to the chart that needs to use it to display data.
The following methods are available to add a displayer:
IlvBoolean addDisplayer(IlvAbstractChartDisplayer* displayer,
IlvChartDataSet* dataSet = 0,
IlvChartCoordinateInfo* ordinateInfo = 0,
IlvUInt position = IlvLastPositionIndex)
and
virtual IlvBoolean addDisplayer(IlvAbstractChartDisplayer* displayer,
IlvUInt count,
IlvChartDataSet* const* dataSets,
IlvChartCoordinateInfo* ordinateInfo = 0,
IlvUInt position = IlvLastPositionIndex)
The first method is used for adding displayers that display only one data set, such as the scatter displayer, the polyline displayer, the marked polyline displayer, and so on. The second method is used for adding displayers that display several data sets, such as the high-low displayer, the high-low open-close displayer, and so on.
The data set(s) that will be displayed by the added displayer should be passed as a parameter. Otherwise, the displayer will be added but the corresponding graphical representation will not be displayed since no data to be represented are specified.
Note: The data sets that are passed as parameters must be managed by the chart data object set on the chart. |
It is also possible to specify the ordinate scale that will be considered by the displayer to display the data. This is done by passing the coordinate information object associated with the ordinate scale as a parameter. If no coordinate information object is passed as a parameter, the ordinate scale that will be considered is the main ordinate scale. If several ordinate scales are displayed, the main ordinate scale corresponds to the ordinate scale displayed by the first ordinate scale displayer object that is defined (that is, the ordinate scale displayer at the index 0).
You can also specify the position at which the displayer is added. This allows you to indicate the order in which you want the graphical representations of data to be displayed since the displayers are considered in the order of the indexes.
Examples
We can use a scatter displayer that displays a single data set as an example. We can add this displayer to a chart by using the following code:
chart->addDisplayer(scatterDisplayer, dataSet); |
See
Scatter Displayer to see how to create a scatter displayer.
Another example is a high-low open-close displayer that displays four data sets. We can add this displayer to a chart by using the following code:
IlvChartDataSet* dataSets[4]; dataSets[0] = lowValuesDataSet; dataSets[1] = highValuesDataSet; dataSets[2] = openValuesDataSet; dataSets[3] = closeValuesDataSet; |
chart->addDisplayer(hiLoDisplayer, 4, dataSets); |
See
High-Low Open-Close Displayer to see how to create a high-low open-close displayer.
Version 6.3
Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.