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