1.横轴显示时间

 zedGraphControl2.GraphPane.XAxis.Type = AxisType.Date;

 zedGraphControl2.GraphPane.XAxis.Scale.Format = "hh:mm";

 PointPairList list1 = new PointPairList();

 list1.Add((double)new XDate(ls[i - 1].dtime), ls[i - 1].volume);

 LineItem myCure = zedGraphControl2.GraphPane.AddCurve("流量", list1, Color.Blue, SymbolType.Diamond);

2.重新绘制

  zedGraphControl2.GraphPane.CurveList.Clear();

  zedGraphControl2.AxisChange();

  zedGraphControl2.Refresh();

3.绘制饼图  

  // 定义生成随机数方法

  Random rand = new Random();

  GraphPane myPane = zedGraphControl2.GraphPane;

  // 清除已有数据

  myPane.CurveList.Clear();

  // 饼图的几个部分 依次为值,颜色

  PieItem segment1 = myPane.AddPieSlice(rand.Next(), Color.Red, .0, "过饱和路段");

  PieItem segment2 = myPane.AddPieSlice(rand.Next(), Color.Green, 0, "畅通路段");

  PieItem segment3 = myPane.AddPieSlice(rand.Next(), Color.Yellow, .0, "饱和路段");

   // 图例的位置

  myPane.Legend.Position = LegendPos.Right;

  // 是否在   segment1.LabelType = PieLabelType.None;

  segment2.LabelType = PieLabelType.None;

  segment3.LabelType = PieLabelType.None;

  myPane.Legend.FontSpec.Size = 30f;

  myPane.Title.IsVisible = false;

  myPane.Fill = new Fill(Color.Cornsilk);

  myPane.Chart.Fill = new Fill(Color.Cornsilk);

相关文章:

  • 2021-07-20
  • 2022-12-23
  • 2021-04-13
  • 2022-12-23
  • 2022-01-02
  • 2022-12-23
  • 2022-12-23
  • 2021-06-08
猜你喜欢
  • 2021-08-18
  • 2022-01-20
  • 2021-07-25
  • 2021-08-05
  • 2021-09-11
  • 2021-07-21
  • 2021-09-09
相关资源
相似解决方案