Using the Charts Library > The IlvXMLChartData Class > Tags Definition > Customizing Value and Date List Processing
 
Customizing Value and Date List Processing
If you need a specific treatment of any value lists, it is possible to give your own value list processor to the IlvXMLChartData class. To do this, derive IlvXMLValueListProcessor and override the processValueList() method. Then use registerValueListProcessor() to get it used by the IlvXMLChartData object.
Note: You can specify any kind of type name to be processed. The ones that are already defined are double or date, but you can create your own type if you need to.
For example:
<series id="X_DS_C" type="my_type">
<valuesList>a,d,e,f,i,l</valuesList>
</series>
would be parsed with a MyValueListProcessor object, which would be registered as follows:
xmlChartData->registerValueListProcessor(IlString("my_type"), new MyValueListProcessor);
This is particularly useful if you need to parse date values written in a different format than the default one (dd/mm/yy). This is slightly easier using the IlvXMLDateListProcessor class, which has a specific method to override, parseDate().
So, supposing you need to parse:
<series id="X_DS_C" type="date">
<valuesList>01dec90,12jan91,14jul91,25sep91,15aug92</valuesList>
</series>
You would then have your own MyDateListProcessor class with its own parseDate() method, and register it by using:
xmlChartData->registerValueListProcessor(IlString("my_type"),
new MyDateListProcessor);
It will then replace the default date list processor and be used instead.
Some examples of IlvXMLChartData can be found in the samples/xml directory.

Version 5.5.1
Copyright © 2012, Rogue Wave Software, Inc. All Rights Reserved.