zoukankan      html  css  js  c++  java
  • zedGraph 图表控件总结(一)

    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);

  • 相关阅读:
    HDU 4069 Squiggly Sudoku
    SPOJ 1771 Yet Another NQueen Problem
    POJ 3469 Dual Core CPU
    CF 118E Bertown roads
    URAL 1664 Pipeline Transportation
    POJ 3076 Sudoku
    UVA 10330 Power Transmission
    HDU 1426 Sudoku Killer
    POJ 3074 Sudoku
    HDU 3315 My Brute
  • 原文地址:https://www.cnblogs.com/oftenlin/p/2715627.html
Copyright © 2011-2022 走看看