Hi,
Is it possible to have the axis labels resize when the chart is resized? I.e. if I shrink the chart, the axis labels font size reduces so the labels are still visible and don't overlap.
I read in other posts about a AutoResize property on the Infragistics.Controls.Charts.Label class but this doesn't seem to have this property - is there any other way of doing this?
Thanks,
Oliver
You're welcome. Let me know if you have any other questions.
Thanks Rob for your help
Changing the TextTrimming property and having a custom TickmarkValues as per your attached example worked great
Thanks again,
Hi Oliver,
You're right. I did some digging through the source code and it looks like the axis interval is calculated using an internal TickmarkValues class. It basically checks to see if the gap between tickmarks is past a certain point and then it adjusts the interval accordingly. The axis labels themselves must be setting the TextTrimming property on the TextBlocks so the "..." automatically get added. You can stop this by providing a custom DataTemplate to the NumericXAxis.Label property but you will just end up with overlapping labels instead of having the "..." added.
It looks like the way we expected users to modify this behavior is to provide their own TickmarkValues class and then implement the Interval changing logic which would then keep the labels from overlapping. Check out my sample that I attached for an example on how you can adjust the label intervals to keep them from overlapping.
Thanks Rob
We mainly use the numeric axis and after doing some more testing I realise that you're correct it does automatically reduce the tickmarks as the chart size reduces but only after the tick labels have been swtiched to '...'.
So on my chart I have x-axis tickmarks 1000, 2000, 3000, etc. I reduce the chart size and as the values start to overlap the values are switched by the charting engine to '...' instead of the numeric value. Once these '...' values start to overlap only then do the number of tickmarks reduce which then can cause some numeric tick mark values to be displayed again.
Is it possible to stop the values reverting to '...' and instead prioritise reducing the number of tickmarks instead?
I believe the tickmarks are controlled by the Interval property of the axis. So one thing you can do is increase the interval as the char size reduces. Our numeric axis should already do something like this unless you have set the Interval property (leaving the Interval property with it's default value will cause the chart to calculate it's own interval). Our category axis, however, does not do this so here it might be beneficial for you to increase the Interval manually as the chart size decreases.