C#绘制两条曲线,兼具导入导出功能

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Collections;
using System.IO;
using System.Data;
using System.Drawing;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Forms.DataVisualization.Charting;
using Color = System.Drawing.Color;
using OfficeOpenXml;
using Microsoft.Win32;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TaskbarClock;
using static mySiC_Framework.NewPage5;

using static System.Windows.Forms.VisualStyles.VisualStyleElement;
using System.Windows.Forms;

namespace mySiC_Framework
{
    /// <summary>
    /// NewPage.xaml 的交互逻辑
    /// </summary>
    public partial class NewPage5 : System.Windows.Controls.Page
    {
        private ChartArea AREA = new ChartArea() { Name = "Line" };             // 画图区域
        private Series SERIES1 = new Series();                                   // 一条折线
        private Series SERIES2 = new Series();                                   // 一条折线
        private Legend LEGEND1 = new Legend();                                   // 一个图例
        private Legend LEGEND2 = new Legend();                                   // 一个图例
        private System.Timers.Timer timer = new System.Timers.Timer();          // 定时器
        private int INTERVAL = 500;                                             // 定时器时间
        private int MAXPLOT = 100;                                              // 图中最多点数
        private DataTable dataTable = new DataTable("MyData");
        //private TextBox textData;
        public NewPage5()
        {
            InitializeComponent();
           
            // area样式设置
            AREA.AxisX.Enabled = AxisEnabled.True;                          // 使X轴可用
            AREA.AxisX.IntervalAutoMode = IntervalAutoMode.VariableCount;   // X 轴标签数量,由显示的数据点数量自动调整
            AREA.AxisY.Enabled = AxisEnabled.True;
            AREA.AxisY.MajorTickMark.Enabled = true;

            AREA.CursorX.IntervalType = DateTimeIntervalType.Auto;
            AREA.CursorX.IsUserSelectionEnabled = true;                     // 鼠标选择区域放大
            AREA.CursorX.SelectionColor = Color.SkyBlue;
            AREA.CursorY.AutoScroll = true;
            AREA.AxisX.ScrollBar.ButtonStyle = ScrollBarButtonStyles.All; //启用X轴滚动条按钮
            //调色
            AREA.BackColor = Color.AliceBlue;                //背景色
            AREA.BackSecondaryColor = Color.White;           //渐变背景色
            AREA.BackGradientStyle 
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值