我的实时曲线,在鼠标滚动,图线变小时,左边没有图线,没有坐标显示,只有右边有实时曲线,都移向了右边。能帮帮我吗?这个问题纠结好久了,老解决不了

解决方案 »

  1.   


    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using ZedGraph;
    namespace 我的实时曲线1
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }
            Random ran = new Random();         PointPairList list = new PointPairList();
            PointPairList list2 = new PointPairList();
            LineItem myCurve;
            private void Form1_Load(object sender, EventArgs e)
            {
                            this.zedGraphControl1.GraphPane.Title.Text = "动态折线图";            this.zedGraphControl1.GraphPane.XAxis.Title.Text = "时间";            this.zedGraphControl1.GraphPane.YAxis.Title.Text = "数量";            this.zedGraphControl1.GraphPane.XAxis.Type = ZedGraph.AxisType.DateAsOrdinal;
                //this.zedGraphControl1.GraphPane.XAxis.Type = AxisType.Date;
                this.zedGraphControl1.GraphPane.XAxis.Scale.Format = "HH:mm:ss";
                //this.zedGraphControl1.GraphPane.IsShowContextMenu = false;            
                DateTime dt = DateTime.Now;            for (int i = 0; i <= 100; i++)
                {                double x = (double)new XDate(DateTime.Now.AddSeconds(-(50 - i)));                double y = ran.NextDouble();
                    double x2= (double)new XDate(DateTime.Now.AddSeconds(-(80 - i)));                double y2 = ran.NextDouble();                list.Add(x, y);                list2.Add(x2, y2);
                }            myCurve = zedGraphControl1.GraphPane.AddCurve("My Curve",                    list, Color.DarkGreen, SymbolType.None);            //myCurve2 = zedGraphControl1.GraphPane.AddCurve("My Curve2",            //        list2, Color.Blue, SymbolType.None);
                ////LineItem myCurve = myPane.AddCurve("Porsche",
                //list1, Color.Red, SymbolType.Diamond);
                this.zedGraphControl1.AxisChange();            this.zedGraphControl1.Refresh();        }        private void timer1_Tick(object sender, EventArgs e)
            {
                zedGraphControl1.GraphPane.XAxis.Scale.MaxAuto = true;            double x = (double)new XDate(DateTime.Now);            double y = ran.NextDouble();
                double x2= (double)new XDate(DateTime.Now);            double y2= ran.NextDouble();
                //this.timer1.Tick += new System.EventHandler(this.timer1_Tick);            list.Add(x, y);            list2.Add(x2, y2);
                this.zedGraphControl1.AxisChange();            this.zedGraphControl1.Refresh();
                if (myCurve.NPts > 100)
                {
                    myCurve.RemovePoint(0);
                    //myCurve2.RemovePoint(0);
                }
                
            }        
        }
    }
    这个代码,有没有问题?
      

  2.   

    我有C#自定义统计图控件,qq:1277874734
      

  3.   

    我有C#自定义统计图控件,qq:1277874734