I want to prevent the Y axis from being scrolled and changing the range of the parallel chart. Is there no way?
AxisY axisYWeight = new AxisY(_chart.ViewXY);
axisYWeight.SetRange((double)min, (double)max);
axisYWeight.Title.Text = Prop.ITEM_NM;
axisYWeight.Title.VerticalAlign = YAxisTitleAlignmentVertical.Top;
axisYWeight.Position = _chart.ViewXY.YAxes.Count * positionInterval;
I don't want to change the y-axis range of a parallel chart by scrolling.
Moderator: Queue Moderators
-
- Posts: 5
- Joined: Fri Jul 02, 2021 8:01 am
-
- Posts: 141
- Joined: Wed Mar 27, 2019 1:05 pm
Re: I don't want to change the y-axis range of a parallel chart by scrolling.
Hello,
There are several properties controlling axis scrolling and other actions that modify axis range.
-AllowScrolling - when disabled, user cannot scroll the axis by dragging it with mouse.
-AllowScaling - when disabled, user cannot rescale the axis by dragging the scale nibs at the ends of the axis.
-ZoomingEnabled - determines if zooming actions affect this axis.
-PanningEnabled - determines if panning affects this axis
There is also RangeChanged -event which allows you to define various limits for the axis. For example, prevent axis minimum going below zero. It is also possible to stop all axis range changes inside the event.
Best regards,
Lasse
There are several properties controlling axis scrolling and other actions that modify axis range.
-AllowScrolling - when disabled, user cannot scroll the axis by dragging it with mouse.
-AllowScaling - when disabled, user cannot rescale the axis by dragging the scale nibs at the ends of the axis.
-ZoomingEnabled - determines if zooming actions affect this axis.
-PanningEnabled - determines if panning affects this axis
There is also RangeChanged -event which allows you to define various limits for the axis. For example, prevent axis minimum going below zero. It is also possible to stop all axis range changes inside the event.
Code: Select all
_chart.ViewXY.YAxes[0].AllowScrolling = false;
_chart.ViewXY.YAxes[0].AllowScaling = false;
_chart.ViewXY.YAxes[0].ZoomingEnabled = false;
_chart.ViewXY.YAxes[0].PanningEnabled = false;
_chart.ViewXY.YAxes[0].RangeChanged += YAxis_RangeChanged;
private void YAxis_RangeChanged(object sender, RangeChangedEventArgs e)
{
// Axis range never changes
if (e.NewMax != 10)
_chart.ViewXY.YAxes[0].Maximum = 10;
if (e.NewMin != 0)
_chart.ViewXY.YAxes[0].Minimum = 0;
}
Lasse