|
Custom X-axis labels without changing scale in ChartDirecto |
| Posted by nykang on Dec-10-2025 17:16 |
|
Hello,
I am plotting a line chart with double XData (timestamps) in ChartDirector. The incoming timestamps are non-continuous, so I want to use them only as labels on the X-axis. Internally, I use continuous X values to represent the scale for correct plotting, scrolling, and zooming.
I tried:
xAxis()->setLabels(StringArray) – replaces labels but also changes the scale, breaking scrolling/zoom.
xAxis()->addMark(x, …, label, …) – labels appear, but the original numeric XData is still drawn.
Is there a way to replace only the displayed X-axis labels with custom strings while keeping the numeric scale and zoom/scroll intact?
Thank you. |
Re: Custom X-axis labels without changing scale in ChartDirecto |
| Posted by Peter Kwan on Dec-11-2025 02:48 |
|
Hi nykang,
Axis.addMark is one possible method. You can disable the automatically generated labels labels by setting them to transparent. If the labels are transparent, ChartDirector will skip them.
c->xAxis()->setLabelStyle("Arial", 8, Chart::Transparent);
Best Regards
Peter Kwan |
|