Hello,
I have issues with major step on the y linearAxis changing when zooming in. Generated ticks and corresponding grid is displayed correctly only in the case when whole chart is shown (zoom = 1). When I zoom in, interval between ticks on y axis is changed. Please note that I have applied similar logic on the zoom event on the x axis and it's working fine. However, it seems that MajorStep on the linear y axis cannot be changed in the same like MajorTickInterval on the categorical x axis. So, how to keep interval between ticks on the y axis constant after changing the zoom settings?
Here is the code snippet I'm using:
private
void
View_ZoomChanged(
object
sender, EventArgs e)
{
var horizontalAxis = radChartView1.Axes[0]
as
CategoricalAxis;
int
DesiredHorizontalTickInterval = 12;
double
horizontalScale = (radChartView1.View
as
IChartView).ZoomWidth;
int
zoomWidth = (
int
)(horizontalScale + .5);
if
(horizontalAxis.MajorTickInterval != zoomWidth * DesiredHorizontalTickInterval)
{
horizontalAxis.MajorTickInterval = zoomWidth * DesiredHorizontalTickInterval;
}
int
desiredVerticalMajorStep = 7;
double
verticalScale = (radChartView1.View
as
IChartView).ZoomHeight;
int
zoomHeight = (
int
)(verticalScale + .5);
var yAxis = ((sender
as
ChartView).Axes.Last()
as
LinearAxis);
if
(yAxis.MajorStep != zoomHeight * desiredVerticalMajorStep)
{
yAxis.MajorStep = zoomHeight * desiredVerticalMajorStep;
}
}