Hi idaks,
This kind of axis is commonly used in financial charts. In financial charts, we often skip Saturdays and Sundays. For intraday chart, we may skip lunch hours and other non-trading hours.
The method to create the chart is to treat the x-data as labels. It is like:
c->addBarLayer(DoubleArray(yData, size), ...);
c->xAxis()->setLabels(DoubleArray(xData, size));
c->xAxis()->setLabelFormat("{value|hh:nn}");
If you have many x-axis labels, and you only want to display some of them, you can use Axis.setLabelStep, or you can use Axis.setMultiFormat with filters. An example is:
// Only display the labels which are the first label of an hour
c->xAxis()->setMultiFormat(Chart::StartOfHourFilter(), "{value|hh:nn}");
See:
http://www.advsofteng.com/doc/cdcpp.htm#Axis.setMultiFormat.htm
http://www.advsofteng.com/doc/cdcpp.htm#Axis.setMultiFormat2.htm
Hope this can help.
Regards
Peter Kwan |