|
How to set the axis label between tick marks for the Line chart |
Posted by moses on Jan-10-2024 15:07 |
|
Hello,
We have a feature request that allows users to set the axis label between the tick marks, how to set it in C++?
|
Re: How to set the axis label between tick marks for the Line chart |
Posted by Peter Kwan on Jan-10-2024 19:12 |
|
Hi Moses,
Are you referring to the x-axis labels (the labels "12/31/2014", "1/31/2015" ....)?
You can set the labels to any text you like. The exact method depends on how the chart is set up.
In the simplest case, if your code provides the x-axis labels as a StringArray, you can simply modify your StringArray based on user input, and then redraw the chart. For example, consider the sample code below:
https://www.advsofteng.com/doc/cdcpp.htm#multiline.htm
The x-axis labels are set up using Axis.setLabels. You can provide a user interface to allow the user to edit the list of labels, then set up the StringArray based on the user input, then redraw the chart. Usually, no additional code is needed to redraw the chart, as it is the same code that draws the chart in the first place.
If some chart setup, your code does not provide and cannot predict what are the x-axis labels (eg. the labels are automatically determined by ChartDirector based on the data). In this case, other method would be needed. Please let me know if this is the case.
Best Regards
Peter Kwan |
Re: How to set the axis label between tick marks for the Line chart |
Posted by moses on Jan-10-2024 21:16 |
|
I mean how to set the axis label in the middle of two tick marks, not on a tick mark.
In Excel, there is a option can set it.
|
Re: How to set the axis label between tick marks for the Line chart |
Posted by moses on Jan-11-2024 17:02 |
|
Thanks, it's helpful. |
|