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

  • 相关阅读:
    Android笔记:数据储存
    Android笔记:管理所有活动
    Android随笔:属性
    Android笔记:限定符
    Android笔记:ninepatch
    Android笔记:获取屏幕信息
    js自动完成
    动态生成实体类
    EF框架学习手记
    js遮罩效果
  • 原文地址:https://www.cnblogs.com/oftenlin/p/2715627.html
Copyright © 2011-2022 走看看