WPF oxyPlot 利用总结
(吐槽下:Nuget会见很慢) 你也可以直接通过上面的直通门去下载最新的源码本身编译, 0,包括:LineSerial(线条--可以通过界说点举办画线条)、FunctionSerial(函数曲线)、AreaSerial(区域)、StairSerial等,笔者就只用到前两者,Minimum=0, 接下来实现一个画直线以及sin(x)的函数线的例子举办说明,同时将界说好的直线以及sin(x)函数线添加该属性上,结果如下图所示 //界说y轴LinearAxis leftAxis = new LinearAxis(){Position=AxisPosition.Left,//图表缩放成果封锁//MajorGridlineStyle = LineStyle.Solid。
//显示标题位置IsZoomEnabled = false。
在PlotViewModel内部添加SimplePlotModel属性(范例:PlotModel),详细的实现如下代码 PlotViewModel结构函数 public PlotViewModel(){SimplePlotModel=new PlotModel();//线条var lineSerial = new LineSeries() { Title=直线实例};lineSerial.Points.Add(new DataPoint(0, 到此, 10));SimplePlotModel.Series.Add(lineSerial);//函数sin(x)var funcSerial = new FunctionSeries((x) = { return Math.Sin(x); },所以我们可以通过挪用SimplePlotModel.InvalidatePlot(true)举办刷新xmal上的图像, y));SimplePlotModel.InvalidatePlot(true);Thread.Sleep(500);}}); 5、本文例子的源码下载 源码(假如以为不错请点赞下,已经将Oxyplot的类库引用到指定的应用措施上,//子刻度配置格网样式//MinorGridlineColor = OxyColor.Parse(#666b8d)}; 4、及时动态添加曲线 现实傍边我们较量常用的及时获取数据生成曲线,在MainWindow.xaml举办界说PlotView标签,//显示标题位置TitleColor = OxyColor.Parse(#d3d3d3)。
而且在PlotViewMode结构函数内部举办实例化,最大10,如下例举较量常用的坐标轴属性(PS:x轴的配置想雷同),//坐标轴缩放封锁IsPanEnabled = false,Maximum=10,相应的代码如下所示: var rd = new Random();Task.Factory.StartNew(() ={while (true){var x = rd.NextDouble() * 1000 % 10;var y = rd.NextDouble() * 50 % 9;lineSerial.Points.Add(new DataPoint(x,//显示标题内容TitlePosition = 1。
0.1。
Install-Package OxyplotInstall-Package Oxyplot.Wpf 你也可以在应用措施--引用--右键--打点Nuget包举办检索oxyplot要害字,同时绑定SimplePlotModel,个中包括了LinearAxis、DateAxis、LogarithmicAxis、 CategoryAxis等较量实用的坐标轴 我们可以直接界说一个LinearAxis举办界说X、Y轴从0开始,//主刻度配置格网//MajorGridlineColor = OxyColor.Parse(#7379a0),可以看到相应的类库引用,然后利用Nuget节制台安装OxyPlot和OxyPlot.wpf直接键入, 新建一个wpf应用措施, 2、 建设PlotViewModel浅易画曲线 在OxyPlot内部可以通过Serial举办界说图表。
//MinorGridlineStyle = LineStyle.Dot, 0));lineSerial.Points.Add(new DataPoint(10, y=sin(x));SimplePlotModel.Series.Add(funcSerial);} MainWindow.xmal Gridoxy:PlotView Model={Binding Path= SimplePlotModel}/oxy:PlotView/Grid /// summary/// MainWindow.xaml 的交互逻辑/// /summarypublic partial class MainWindow : Window{private PlotViewModel _viewModel;public MainWindow(){InitializeComponent();_viewModel = new PlotViewModel();//画直线this.DataContext = _viewModel;}} 将会获得如下图所示的图标 3、定制坐标轴 在OxyPlot可以通过Axes举办自界说坐标轴,卤鸽在此感激) 。
笔者只以简朴的直线添加点进动作态生成线条,有误的话请指出,Title = Y轴, 10,。
相关热词:
本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!
本文地址: https://v30.fanwenzhu.com/jiaob/net/12997.shtml
热门TAG
win10 ecshop 主机 阿里云 解决 配置 C# C++ 解析 SQL语句 命令 Go语言 方法 CSS3 HTML5 CSS win7 MSSQL 服务器配置 IIS7.5 IIS7 IIS6 IIS CentOS 7 Linux oracle数据库 oracle phpcms discuz discuz教程最新文章
-
PS:这里需要注意
时间:2021-01-22
-
以为这个版本出来
时间:2021-01-22
-
搜索winform designer
时间:2021-01-22
-
全新的membership框架Asp.ne
时间:2021-01-21
-
i dont know;18if (msg.Contains(
时间:2021-01-21
-
统筹管理路由规则.
时间:2021-01-21
-
根据switch-case语句来逐一判
时间:2021-01-21
-
EntityFramework 5.0 CodeFirst 教
时间:2021-01-21
热门文章
-
.NET 开发环境搭建图文详解
时间:2020-12-27
-
Windows下Visual Studio 2017安装配置方法图文教
时间:2020-12-23
-
PS: 如果项目中使用了通用主机或者ASP.
时间:2021-01-12
-
.Net微信网页开发解决用户在不同公众号或
时间:2021-01-03
-
oracle 11g rac安装之grid报错解决
时间:2020-12-28
-
以为这个版本出来
时间:2021-01-22
-
ASP.NET Core 3.0使用gRPC的具体方法
时间:2020-12-26
-
SpringBoot实战之文件上传存入AzureStorage
时间:2020-12-29
-
不用找了,比较全的signalR例子已经为你准
时间:2020-12-29
-
.NET Core3.1编写混合C++程序
时间:2020-12-26
