Chinaunix首页 | 论坛 | 博客
  • 博客访问: 250940
  • 博文数量: 45
  • 博客积分: 170
  • 博客等级: 入伍新兵
  • 技术积分: 488
  • 用 户 组: 普通用户
  • 注册时间: 2012-09-13 14:43
文章分类

全部博文(45)

文章存档

2014年(2)

2013年(35)

2012年(8)

我的朋友

分类: C#/.net

2013-08-01 22:10:21


点击(此处)折叠或打开

  1. this.zedGraphControl1.GraphPane.CurveList.Clear();
  2. this.zedGraphControl1.GraphPane.GraphObjList.Clear();
  3. this.zedGraphControl1.IsShowCursorValues = false;
  4. this.zedGraphControl1.IsShowPointValues = true;//数据节点
  5. //this.zedGraphControl1.GraphPane.Y2AxisList.Clear();
  6. //this.zedGraphControl1.GraphPane.YAxisList.Clear();
  7. this.zedGraphControl1.IsEnableHZoom = false;
  8. this.zedGraphControl1.IsEnableVZoom = false;
  9. this.zedGraphControl1.GraphPane.Title.Text = dtime.Month + "-" + dtime.Day + "至" + dtime.AddDays(1).Month + "-" + dtime.AddDays(1).Day + "整点水位预测";
  10. //this.zedGraphControl1.GraphPane.XAxis.Type = ZedGraph.AxisType.DateAsOrdinal;
  11. LineItem curve = this.zedGraphControl1.GraphPane.AddCurve("水位", null,listy, Color.Blue, SymbolType.None);
  12. //显示数据
  13. const double offset = 0.0;
  14. this.zedGraphControl1.GraphPane.Chart.Fill = new Fill(Color.White, Color.FromArgb(255, Color.ForestGreen), 45.0F);
  15. for (int i = 0; i < water_height.Length; i++)
  16. {
  17.   // Get the pointpair
  18.   PointPair pt = curve.Points[i];
  19.   // Create a text label from the Y data value
  20.   TextObj text = new TextObj(pt.Y.ToString(), pt.X, pt.Y + offset, CoordType.AxisXYScale, AlignH.Center, AlignV.Bottom);

  21.   text.ZOrder = ZOrder.A_InFront;
  22.   // Hide the border and the fill
  23.   text.FontSpec.Border.IsVisible = false;
  24.   text.FontSpec.Fill.IsVisible = false;
  25.   text.FontSpec.Angle = 1; //字体倾斜度
  26.   text.FontSpec.Size = 13;
  27.   text.FontSpec.FontColor = Color.Red;
  28.   //myPane.GraphObjList.Add(text);
  29.   this.zedGraphControl1.GraphPane.GraphObjList.Add(text);
  30. }
  31. this.zedGraphControl1.GraphPane.XAxis.Scale.TextLabels = labels;
  32. this.zedGraphControl1.GraphPane.XAxis.Type = AxisType.Text;   //X轴类型 
  33. this.zedGraphControl1.AxisChange();
  34. this.zedGraphControl1.Refresh();


阅读(4042) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~