Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/268.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# OxyPlot WPF视图最大值_C#_Wpf_Oxyplot - Fatal编程技术网

C# OxyPlot WPF视图最大值

C# OxyPlot WPF视图最大值,c#,wpf,oxyplot,C#,Wpf,Oxyplot,我试图在平移后在y轴上找到最大视图和最小视图。因为我想缩放屏幕 代码 } Y轴有一些属性VIEWMAX和ViewMinimum。但它们都是空的。 **在创建Y轴之前获取数据。这将允许您找到最小和最大y值,然后设置y轴的最小和最大值 要获得最小点和最大点,可以按Y值排序,然后取第一个点和最后一个点 var orderedSeries = yourDataSeries.OrderBy(o => o.YValue).ToList(); int lowestPoint = orderedSeri

我试图在平移后在y轴上找到最大视图和最小视图。因为我想缩放屏幕

代码

}

Y轴有一些属性VIEWMAX和ViewMinimum。但它们都是空的。
**

在创建Y轴之前获取数据。这将允许您找到最小和最大y值,然后设置y轴的最小和最大值

要获得最小点和最大点,可以按Y值排序,然后取第一个点和最后一个点

var orderedSeries = yourDataSeries.OrderBy(o => o.YValue).ToList();

int lowestPoint = orderedSeries.First.YValue;
int highestPoint = orderedSeries.Last.YValue;

Y = new OxyPlot.Axes.LinearAxis()
{
    Minimum = lowestPoint,
    Maximum = highestPoint,
    Position = OxyPlot.Axes.AxisPosition.Left,
    IsPanEnabled = false
};
你应该看看类似的东西


希望这有帮助

为什么这个问题会被记下来?
var orderedSeries = yourDataSeries.OrderBy(o => o.YValue).ToList();

int lowestPoint = orderedSeries.First.YValue;
int highestPoint = orderedSeries.Last.YValue;

Y = new OxyPlot.Axes.LinearAxis()
{
    Minimum = lowestPoint,
    Maximum = highestPoint,
    Position = OxyPlot.Axes.AxisPosition.Left,
    IsPanEnabled = false
};