WPF——OXY绘图_old
plotModel = new PlotModel()
{
Title = "数据统计",
LegendTitle = "Max:红色,Min:黄色",
LegendOrientation = LegendOrientation.Horizontal,
LegendPlacement = LegendPlacement.Inside,
LegendPosition = LegendPosition.TopRight,
LegendBackground = OxyColor.FromAColor(, OxyColors.Beige),
LegendBorder = OxyColors.Black,
DefaultFont = "微软雅黑",
}; #region X,Y轴 //X轴
var _dateAxis = new DateTimeAxis()
{
MajorGridlineStyle = LineStyle.Solid,
MinorGridlineStyle = LineStyle.Dot,
IntervalLength = ,
IsZoomEnabled = false,
IsPanEnabled = false,
StringFormat = "M/d HH:mm:ss",
Title = "时间"
};
plotModel.Axes.Add(_dateAxis); //Y轴
var _valueAxis = new LinearAxis()
{
Title = "数值",
Maximum = usl + usl / ,
Minimum = lsl - lsl / ,
MajorGridlineStyle = LineStyle.Solid,//主刻度设置格网
MinorGridlineStyle = LineStyle.Dot,//子刻度设置格网样式
IntervalLength = ,
Angle = ,
IsZoomEnabled = true,//坐标轴缩放
IsPanEnabled = true,//图表缩放功能
Position = AxisPosition.Left,
};
plotModel.Axes.Add(_valueAxis); #endregion #region 线条 //动态线条
var lineSerial = new LineSeries()
{
Title = SvidSelected.ParaName,//eqpParam name
Color = OxyColors.Black,
Smooth = true,
MarkerType = MarkerType.Circle,
StrokeThickness = ,
MarkerSize = ,
MarkerStroke = OxyColors.BlueViolet,
};
plotModel.Series.Add(lineSerial); Task.Factory.StartNew(() =>
{
for (int i = ; i < resData.Count; i++)
{
lineSerial.Points.Add(DateTimeAxis.CreateDataPoint(resData[i].occurenceTime, resData[i].val));
plotModel.InvalidatePlot(true); //每秒刷新一次视图
//Thread.Sleep(200);
}
sw.Stop();
TotalDate = "总渲染时间(毫秒):" + sw.ElapsedMilliseconds;//sw.ElapsedTicks / (decimal)Stopwatch.Frequency;
}); #endregion #region 上限,下限,中线 //添加标注线
var lineMaxAnnotation = new LineAnnotation()
{//上限
Type = LineAnnotationType.Horizontal,
Y = usl,
Text = "上限:" + usl,
Color = OxyColors.Red,
LineStyle = LineStyle.DashDashDot,
StrokeThickness =
};
plotModel.Annotations.Add(lineMaxAnnotation); var lineMinAnnotation = new LineAnnotation()
{//下限
Type = LineAnnotationType.Horizontal,
Color = OxyColors.Blue,
LineStyle = LineStyle.Dash,
StrokeThickness = ,
Y = lsl,
Text = "下限:" + lsl
};
plotModel.Annotations.Add(lineMinAnnotation); var lineMean = new LineAnnotation()
{//平均
Type = LineAnnotationType.Horizontal,
Color = OxyColors.Green,
LineStyle = LineStyle.LongDash,
StrokeThickness = ,
Y = mean,
Text = "平均:" + mean
};
plotModel.Annotations.Add(lineMean); #endregion #region 最大值,最小值 var min = new ScatterSeries();
var maxDataPoint = DateTimeAxis.CreateDataPoint(maxPoint.occurenceTime, maxPoint.val);
min.Points.Add(new ScatterPoint(maxDataPoint.X, maxDataPoint.Y, ));
min.MarkerFill = OxyColor.FromAColor(, OxyColors.Red);
min.MarkerType = MarkerType.Circle;
plotModel.Series.Add(min); var max = new ScatterSeries();
var minDataPoint = DateTimeAxis.CreateDataPoint(minPoint.occurenceTime, minPoint.val);
max.Points.Add(new ScatterPoint(minDataPoint.X, minDataPoint.Y, ));
max.MarkerFill = OxyColor.FromAColor(, OxyColors.Yellow);
max.MarkerType = MarkerType.Circle;
plotModel.Series.Add(max); #endregion
WPF——OXY绘图_old的更多相关文章
- WPF——OXY绘图
private PlotModel _plotModel; public PlotModel plotModel { get { return _plotModel; } set { _plotMod ...
- WPF 在绘图控件(Shape)中添加文字 [2018.7.15]
原文:WPF 在绘图控件(Shape)中添加文字 [2018.7.15] Q:使用Shape的子类Ellipse画一个圆,如何在圆中添加文字? A:Shape类中不包含Text属性.可使用Shape类 ...
- WPF特效-绘图
原文:WPF特效-绘图 WPF玩起来还是挺炫酷的.我实现的效果:不同色块交叉,交叉部分颜色叠加显示.(叠加部分暂时用随机颜色代替).单独色块点击弹出以色块颜色为主的附 ...
- WPF 实时绘图的逻辑
实时绘图实际上是两个线程.外部线程直接用thread,只有到绘图那个逻辑才用绘图控件的mycanvas2.Dispatcher.Invoke. 或者说,INVOKE并不是开线程,只是一个绘图的委托而已 ...
- WPF中绘图(含调用GDI+)
private void DrawStuff() { // //if (buffer == null) //{ // buffer = new RenderTargetBitmap((int)Back ...
- WPF学习(11)2D绘图
本篇我们来学习WPF的绘图,在2D绘图中主要有这么几个重要的类:Drawing.Visual和Shape,顺便讲下Brush和BitmapEffect. 1 2D绘图 1.1Drawing类 Draw ...
- 《Programming WPF》翻译 第7章 1.图形基础
原文:<Programming WPF>翻译 第7章 1.图形基础 WPF使得在你的应用程序中使用图形很容易,以及更容易开发你的显卡的能力.这有很多图形构架的方面来达到这个目标.其中最重要 ...
- WPF绘制深度不同颜色的3D模型填充图和线框图
原文:WPF绘制深度不同颜色的3D模型填充图和线框图 在机械测量过程中,测量的数据需要进行软件处理.通常测量一个零件之后,需要重建零件的3D模型,便于观察测量结果是否与所测工件一致. 重建的3D模型需 ...
- WPF特效-绘制实时2D激光雷达图
原文:WPF特效-绘制实时2D激光雷达图 接前两篇: https://blog.csdn.net/u013224722/article/details/80738619 https://blog.cs ...
随机推荐
- window当mac用,VirtualBox虚拟机安装os系统
mac的环境让开发者很享受,既可以像在linux环境下开发,又可以享受到几乎window所有支持的工具软件,比如ide,note,browser 我的安装过程 1.首先你有了64位的window7操作 ...
- Nginx配置单项SSL以及双向SSL
Https安全协议的由来? 在实现 HTTPS协议前,我们需要了解 SSL 协议,但其实我们现在使用的更多的是 TLS 加密通讯协议. 那么TLS是怎么保证明文消息被加密的呢?在OSI七层模型中,应用 ...
- 49.react中使用less
1.安装less:npm install less less-loader --save 2.webpack.config.js中配置: oneOf: [ { test: /\.less$/, ...
- HTML 图像标签(img)
一.标签属性 属性就是一个实体的特性,例如:手机的属性有大小,颜色等,HTML标签也有自己的属性. 使用HTML制作网页时,如果想让HTML标签提供更多的信息,可以使用HTML标签的属性加以设置. 语 ...
- Linux应急响应姿势浅谈
一.前记 无论是甲方还是乙方的同学,应急响应可能都是家常便饭,你可能经常收到如下反馈: 运维同事 --> 服务器上存在可疑进程,系统资源占用高: 网络同事 --> 监控发现某台服务器对外大 ...
- 排序算法的c++实现——冒泡排序
冒泡排序 冒泡排序是我们大多数人接触到的第一种排序算法,原理简单易懂,不多解释.说明三点: 1. 冒泡排序是稳定排序,只有当两个元素不同时才会交换: 2. 冒泡排序是原址排序,不需要借助额外的空间; ...
- Pandas 之 DataFrame 常用操作
import numpy as np import pandas as pd This section will walk you(引导你) through the fundamental(基本的) ...
- MyCat教程四:实现读写分离
本文我们来给大家介绍下通过MyCat来实现MySQL的读写分离操作 MyCat读写分离 一.读写分离配置 前面我们已经介绍过了mysql的主从同步和mycat的安装及相关配置文件的介绍,现在我们来 ...
- 2019年杭电多校第一场 1002题Operation(HDU6579+线性基)
题目链接 传送门 题意 初始时有\(n\)个数,现在有\(q\)次操作: 查询\([l,r]\)内选择一些数使得异或和最大: 在末尾加入一个数. 题目强制在线. 思路 对于\(i\)我们记录\([1, ...
- Educational Codeforces Round 65 (Rated for Div. 2)题解
Educational Codeforces Round 65 (Rated for Div. 2)题解 题目链接 A. Telephone Number 水题,代码如下: Code #include ...