资源简介
c#编写的实时趋势示例,使用visual studio自带的chart,定时器实时绘制趋势,可以手动设置纵坐标上下限,也可根据数据实时值自动设置纵坐标上下限。
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;
namespace WindowsFormsApplication1
{
public partial class Form6 : Form
{
public Form6()
{
InitializeComponent();
}
public void CreateYAxis(Chart chart ChartArea area Series series float axisOffset float labelsSize)
{
// Create new chart area for original series
ChartArea areaSeries = chart.ChartAreas.Add(“ChartArea_“ + series.Name);
areaSeries.BackColor = Color.Transparent;
areaSeries.BorderColor = Color.Transparent;
areaSeries.Position.FromRectangleF(area.Position.ToRectangleF());
areaSeries.InnerPlotPosition.FromRectangleF(area.InnerPlotPosition.ToRectangleF());
areaSeries.AxisX.MajorGrid.Enabled = false;
areaSeries.AxisX.MajorTickMark.Enabled = false;
areaSeries.AxisX.Labelstyle.Enabled = false;
areaSeries.AxisY.MajorGrid.Enabled = false;
areaSeries.AxisY.MajorTickMark.Enabled = false;
areaSeries.AxisY.Labelstyle.Enabled = false;
areaSeries.AxisY.IsStartedFromZero = area.AxisY.IsStartedFromZero;
areaSeries.AxisY.LineColor = Color.Red;
series.ChartArea = areaSeries.Name;
/*
// Create new chart area for axis
ChartArea areaAxis = chart.ChartAreas.Add(“AxisY_“ + series.ChartArea);
areaAxis.BackColor = Color.Transparent;
areaAxis.BorderColor = Color.Transparent;
areaAxis.Position.FromRectangleF(chart.ChartAreas[series.ChartArea].Position.ToRectangleF());
areaAxis.InnerPlotPosition.FromRectangleF(chart.ChartAreas[series.ChartArea].InnerPlotPosition.ToRectangleF());
areaAxis.AxisY.LineColor = Color.Red;
areaAxis.AxisY.MajorTickMark.LineColor = Color.Red;
// Create a copy of specified series
Series seriesCopy = chart.Series.Add(series.Name + “_Copy“);
seriesCopy.ChartType = series.ChartType;
foreach (DataPoint point in series.Points)
{
seriesCopy.Points.AddXY(point.XValue point.YValues[0]);
}
// Hide copied series
seriesCopy.IsVisibleInLegend = false;
seriesCopy.Color = Color.Transparent;
seriesCopy.BorderColor = Color.Transparent;
seriesCopy.ChartArea = areaAxis.Name;
// Disable drid lines & tickmarks
areaAxis.AxisX.LineWidth = 0;
areaAxis.AxisX.MajorGrid.Enabled = false;
areaAxis.AxisX.MajorTickMark.Enabled = false;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 962 2017-06-20 10:32 WindowsFormsApplication1.sln
文件 167 2018-05-23 17:22 WindowsFormsApplication1\App.config
文件 15872 2018-05-23 17:24 WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe
文件 167 2018-05-23 17:22 WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe.config
文件 26112 2018-05-23 17:24 WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.pdb
文件 22472 2018-05-23 17:23 WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe
文件 167 2018-05-23 17:22 WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe.config
文件 490 2017-09-29 21:43 WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe.manifest
文件 9068 2018-05-23 17:24 WindowsFormsApplication1\Form6.cs
文件 11775 2018-05-23 17:24 WindowsFormsApplication1\Form6.Designer.cs
文件 6011 2018-05-23 17:24 WindowsFormsApplication1\Form6.resx
文件 40588 2017-12-05 23:46 WindowsFormsApplication1\obj\Debug\DesignTimeResolveAssemblyReferences.cache
文件 7508 2018-05-23 17:22 WindowsFormsApplication1\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 0 2017-06-20 10:32 WindowsFormsApplication1\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
文件 0 2017-06-20 10:32 WindowsFormsApplication1\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
文件 0 2017-06-20 10:32 WindowsFormsApplication1\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
文件 4608 2018-05-23 17:23 WindowsFormsApplication1\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll
文件 7472 2018-05-23 17:24 WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.csproj.FileListAbsolute.txt
文件 975 2018-05-23 17:24 WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.csproj.GenerateResource.Cache
文件 686 2018-05-23 17:24 WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.csproj.ResolveComReference.cache
文件 15872 2018-05-23 17:24 WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.exe
文件 180 2018-05-23 17:19 WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.Form1.resources
文件 180 2018-05-23 17:19 WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.Form2.resources
文件 180 2018-05-23 17:19 WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.Form3.resources
文件 180 2018-05-23 17:19 WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.Form4.resources
文件 180 2018-05-23 17:19 WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.Form5.resources
文件 180 2018-05-23 17:24 WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.Form6.resources
文件 180 2018-05-23 17:19 WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.Form7.resources
文件 180 2018-05-23 17:19 WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.frmContour.resources
文件 180 2018-05-23 17:19 WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.frmProcess.resources
............此处省略43个文件信息
相关资源
- C#使用webBrowser控件获取URL图片
- C#简单矢量作图系统
-
基于C#的 读取xm
l数据的GDI画图 程序 - C#编写的道格拉斯算法演示
- C#把打印中的文件输出为PDF
- 多元函数遗传算法
- c#窗体编写的简单的聊天室系统
-
上位机与欧姆龙PLC的hostli
nk通信 - c#方便调用次世代AntiVC.dll插件
- C# Socket_服务端向指定的客户端发送消
- asp.net-c#写的一个cookie和session登陆小实
- 淘宝、天猫、京东 API接口样例,C# 非
- C#初级不涉及数据库的学生成绩管理系
- C#制作PDF以及源代码.rar
- 单像空间后方交会C#版
- C# Excel导入导出
- 适合于WinCE应用开发的压缩解压缩库
- C#监控剪切板
- 对C#的树型控件TREEVIEW添加背景图片
- 用c#写的五子棋源代码
- C#中在picturebox中实时画矩形框
- C#在一块空间中鼠标中键操作图像
- C#制作qq截图自动框选功能
- 显示所有缓存 清除所有缓存 Asp.net(
- C#自动截屏/定时截屏/自动保存/快捷键
- C# 通过鼠标滚轮实现缩放图片和移动
- C# 动态生成RDLC报表
- C#调用考勤机API读取记录
- c# 真正的线控件直线、斜线而且不会
- C#写的 模拟 cmd界面
评论
共有 条评论