标题:绘图插件zedgraph的滚动轴问题
只看楼主
feige3721
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2010-4-9
结帖率:0
 问题点数:0 回复次数:0 
绘图插件zedgraph的滚动轴问题
我用zedgraph绘图时,用时间轴做的x轴,添加滚动轴后一点滚动轴就找不到图像了,不论滚动轴拉到哪都没有图像,请问这是什么原因?
我用zedgraph自带的滚动轴和winform的滚动轴都这样,但是当x轴改成数字显示的时候滚动轴是好用的,请哪位用过这个插件的同行解释一下,谢谢
下面是绘图程序
  GraphPane myPane = zedGraphControl1.GraphPane;//清空原图像
            myPane.CurveList.Clear();
            myPane.GraphObjList.Clear();
            zedGraphControl1.Refresh();
            myPane.XAxis.Scale.IsVisible = true;
            myPane.XAxis.Scale.Format = " hh:mm:ss";//横轴格式
            myPane.XAxis.Scale.MajorUnit = DateUnit.Millisecond;
            myPane.XAxis.Type = AxisType.Date;
            myPane.XAxis.MajorGrid.IsVisible = true;//底色画网格
            myPane.XAxis.MajorGrid.Color = Color.Green;
            myPane.XAxis.MinorGrid.IsVisible = true;
            myPane.XAxis.MinorGrid.Color = Color.Green;

            LineItem myCurve;
            this.zedGraphControl1.GraphPane.Title.Text = "样本趋势图";

            this.zedGraphControl1.GraphPane.XAxis.Title.Text = "时间";

            this.zedGraphControl1.GraphPane.YAxis.Title.Text = "数值";

            int inum = Convert.ToInt16(ilv.Items.Count.ToString());

            int onum = Convert.ToInt16(olv.Items.Count.ToString());

            int k = inum + onum;
           
            ////////////////////////////////////////////

            for (int j = 2; j < k + 2; j++)
            {
                PointPairList list = new PointPairList();

                for (int i = 0; i < picidataGridView2.RowCount - 1; i++)
                {
                    double xj = (double)new XDate(Convert.ToDateTime(picidataGridView2[0, i].Value.ToString()));
                    double yj = Convert.ToDouble(picidataGridView2[j, i].Value.ToString());
                    list.Add(xj, yj);
                }
            }
下面是winform的滚动轴程序
 private void hScrollBar1_Scroll(object sender, ScrollEventArgs e)
        {
            GraphPane myPane = zedGraphControl1.GraphPane;//横轴滚动条
            myPane.XAxis.Scale.Max = hScrollBar1.Value;
            this.zedGraphControl1.AxisChange();
            this.zedGraphControl1.Refresh();
           
        }
搜索更多相关主题的帖子: 时间 
2011-03-19 10:50



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-334116-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.050844 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved