绘图插件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();
}