Hi,
Is there any option (event?) to change the interval for an axis when the zoom is changed?
I want define one big interval when the zoom is out (months) a middle interval for middle zoom (days) and a fine interval when zoom is in (days).
Thanks in advanced
Some of the axes already implement this kind behavior, and will adjust the interval as you zoom based on the available space to display labels and gridlines.
If you want more finer grained control over the intervals used, you can listen to the WindowRectChanged event:
http://help.infragistics.com/NetAdvantage/DV/2010.3/CLR4.0/?page=InfragisticsSL4.Controls.Charts.XamDataChart.v10.3~Infragistics.Controls.Charts.XamDataChart~WindowRectChanged_EV.html
Which allows you to listen for when the chart's zoom level changes. The window rectangle is initially:
new Rect(0, 0, 1, 1)
which is the full range of the axes. The left of the window rectange is a value from 0 to 1 representing the position of the left of the visible window, the top is a value from 0 to 1 representing the position of the top of the visible window. The width and height of the window rectangle are values from 0 to 1 that represent what percentage of the full width and height of the axes are in view.
For example:
new Rect(.5, .5, .5, .5) whould show you just the lower righthand quadrant of the entire chartspace. For your case, you can examine the width and height of the window rectangle to know how far the user has zoomed into the chart.
Hope this helps!
-Graham
Thanks Graham, with this event I can determine the zoom applied, it works fine.
But, you say:
"Some of the axes already implement this kind behavior, and will adjust the interval as you zoom based on the available space to display labels and gridlines."
How can I do this? the axes only adjust the quantity of labels to be showed (not always correctly, sometimes overlapped), they not offer the ability to change the text in the label.
I can see also, the axes adjust the number of "minorstroke" showed between two "majorstroke". Changing "Interval" property I can change the quantity of "majorstroke", but not found the manner to change the quantity of "minor strokes", Is it possible?
Thanks for the help
Hi Graham,
Knowing the zoom applied with "WindowRectChanged" event, I can change the interval and the pattern for label; finally setting properly "extend" property it works fine for me.
Thanks for help.
Are you using a category axis? The only behavior of this axis as the zoom changes is to adjust the frequency with which the labels/gridlines appear as you have seen. Since the category axis labels are just string values to the chart, it cannot subdivide them any further, if you are using numeric values and are expecting that behavior.
The numeric axes, on the other hand, because they are dealing with numeric values, can further subdivide the intervals as the zoom level increases.
Currently there is no way to adjust the frequency of the minor grid lines manually. If you would find this functionality useful, I would recommend making a feature request and describing your use cases. Currently the chart will automatically decide on the number of minor grid lines to use based on the available space between the major gridlines.
Its important to note that label collision is not a factor that that chart takes into account when deciding on an axis interval. It makes the assumption that if you have over-wide axis labels you will adjust the appropriate axis setting to avoid collisions. Note, though, that there is some automatic staggering of labels that occurs on collision, if you adjust the axis extent to give it space to auto-arrange the labels.