|
[MFC]how to set yaxis grid. |
Posted by Kaiden on Jul-22-2013 15:09 |
|
Hi Peter
I need to make fewer horizontal grid lines.
Just like the picture I attached.
At the moment, there is a line at every 0.2 steps.
but I want it at every 0.5 steps.
would this be possible?
Thanks always.
Best Regards,
Kiaden.
|
Re: [MFC]how to set yaxis grid. |
Posted by Peter Kwan on Jul-23-2013 02:28 |
|
Hi Kaiden,
By default, ChartDirector will put as many labels as possible on the y-axis, but the labels must be "nice numbers". Also, for text flowing from left to right, the vertical spacing between two labels must be at least 20 pixels apart. The labels can be 0.2 units apart in data value, or 0.5 units or 50000 units, depending on your data range.
If you want the labels to space further apart (so there will be less labels on the y-axis), you may use Axis.setTickDensity. For example:
//at least 50 pixels apart
c->yAxis()->setTickDensity(50);
If you want the labels to be at least 0.5 data units apart, you may use Axis.setMinTickInc. For example:
c->yAxis()->setMinTickInc(0.5);
Note that if you set the labels to be 0.5 units apart, depending on your actual data range, there can still be a lot of labels on the y-axis.
Hope this can help.
Regards
Peter Kwan |
Re: [MFC]how to set yaxis grid. |
Posted by Kaiden on Jul-23-2013 07:48 |
|
Thanks Peter!!
You really are a pro. Everything you say, works fine!
Have a greatday!! thanks to you I am starting off really good!
Best Regards,
Kaiden. |
|