如何防止氧曲线图在一个轴上缩放?

时间:2018-09-11 05:52:28

标签: c# .net oxyplot

开始时的图形:

enter image description here

缩放后的图形:

enter image description here

问题::如何保持图形的全部垂直数据可见,而不必上下移动来尝试查看它?

我认为图形需要水平伸展才能做到这一点。我尝试设置最小/最大范围来实现此目的,但是它们似乎没有理想的结果。我无法在文档中找到任何设置来仅禁用一个缩放轴。

1 个答案:

答案 0 :(得分:0)

In the graph plot model, add the desired axis and disable the axis zoom:

var pm = new PlotModel { Title = "My Plot" };

//Define the x axis
DateTimeAxis xAxis = new DateTimeAxis();            
xAxis.Position = AxisPosition.Bottom;

//Define the y axis
LinearAxis yAxis = new LinearAxis();
yAxis.Position = AxisPosition.Left;
//Disable the axis zoom
yAxis.IsZoomEnabled = false;

//Add the Axes to the graph
pm.Axes.Add(xAxis);
pm.Axes.Add(yAxis);

Also, if you don't want to disable the zoom, if you scroll the mouse wheel with he cursor at one axis, the zoom will be applied only to that axis.