博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
zedGraph 图表控件总结(一)
阅读量:6964 次
发布时间:2019-06-27

本文共 1151 字,大约阅读时间需要 3 分钟。

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

转载地址:http://esgil.baihongyu.com/

你可能感兴趣的文章
使用idfc-proguard-maven-plugin混淆优化Jave Web工程二
查看>>
tomcat 设置内存
查看>>
怎么一边敲代码还能一边赚点钱,一字一字敲的,不喜勿喷哈,IOS手机看进来...
查看>>
libevent evhttp_uri_get_query coredump
查看>>
程序员该当命归何处?
查看>>
Log4j调试
查看>>
Most common latch classes and what they mean
查看>>
java 获取数据库表结构通用方法
查看>>
tc命令——Linux基于IP进行流量限速
查看>>
linux centos yum安装LAMP环境
查看>>
Spring中的@Scope注解
查看>>
我用的Android Studio插件
查看>>
html_3基础
查看>>
在 PHP 中实现整数溢出
查看>>
数据类型和Json格式
查看>>
CodeIgniter连接数据库
查看>>
vi vim配置
查看>>
PP日志-Day 3
查看>>
eclipse 调试 jdk 看不到变量的值
查看>>
如何解决分配到Autoconfiguration IPV4 地址
查看>>