当前位置: 首页 > news >正文

C# Chart控件

// 定义图表区域
this.chart1.ChartAreas.Clear();
ChartArea chartArea1 = new ChartArea("C1");
this.chart1.ChartAreas.Add(chartArea1);


//定义存储和显示点的容器
this.chart1.Series.Clear();
Series series1 = new Series("OK");
//series1.ChartArea = "C1";
series1.IsValueShownAsLabel = true;
this.chart1.Series.Add(series1);

Series series2 = new Series("NG");
//series2.ChartArea = "C1";            
series2.IsValueShownAsLabel = true;
this.chart1.Series.Add(series2);


//设置图表显示样式
this.chart1.ChartAreas[0].AxisY.Minimum = 0; //设置Y轴最小值
this.chart1.ChartAreas[0].AxisY.Maximum = 100;//设置Y轴最大值 this.chart1.ChartAreas[0].AxisY.MajorTickMark.Interval = 10;//设置Y轴刻度间隔

this.chart1.ChartAreas[0].AxisX.MajorGrid.Enabled = true;//X轴上网格可见
this.chart1.ChartAreas[0].AxisX.IsMarginVisible = false;//不显示X轴的边缘:


this.chart1.ChartAreas[0].AxisX.Interval = 1;
this.chart1.ChartAreas[0].AxisX.LabelStyle.Angle = -45;
this.chart1.ChartAreas[0].AxisX.MajorGrid.LineColor = System.Drawing.Color.Silver;
this.chart1.ChartAreas[0].AxisY.MajorGrid.LineColor = System.Drawing.Color.Silver;

this.chart1.Series[0].Points.AddXY(0, 88);//添加横坐标为0,纵坐标为88的点

this.chart1.Series[0].BorderWidth = 2;//线条粗细
this.chart1.Series[0].Color = Color.Lime;
this.chart1.Series[1].Color = Color.OrangeRed;

//设置统计饼图样式
this.chart2.Series[0].IsValueShownAsLabel = true;

this.chart2.Series[0].ChartType = SeriesChartType.Pie;

//修改名称

this.chart1.Titles[0].Text = "名称1";

http://www.lryc.cn/news/278150.html

相关文章:

  • OpenCV C++ 图像处理实战 ——《多尺度自适应Gamma矫正的低照图像增强》
  • 原型模式
  • linux centos 账户管理命令
  • 【JavaWeb学习笔记】19 - 网购家居项目开发(上)
  • 强化学习的数学原理学习笔记 - RL基础知识
  • winSCP是什么?它有什么功能和特性?它值不值得我们去学习?我们该如何去学习呢?
  • SpringBoot的数据层解决方案
  • 极客时间-《如何成为学习高手》文章笔记 + 个人思考
  • 【前端】下载文件方法
  • 虚幻UE 材质-纹理 1
  • 回归预测 | Matlab实现RIME-HKELM霜冰算法优化混合核极限学习机多变量回归预测
  • 【AWS系列】巧用 G5g 畅游Android流媒体游戏
  • GNSS数据及产品下载地址(FTP/HTTP)
  • 【STM32】STM32学习笔记-DMA数据转运+AD多通道(24)
  • 即时设计:设计流程图,让您的设计稿更具条理和逻辑
  • 单个独立按键控制直流电机开关
  • 前端插件库-VUE3 使用 JSEncrypt 插件
  • Neo4j备份
  • 【LangChain学习之旅】—(5) 提示工程(上):用少样本FewShotTemplate和ExampleSelector创建应景文案
  • Python从入门到精通秘籍一
  • 【IC设计】移位寄存器
  • 【Flutter 开发实战】Dart 基础篇:最基本的语法内容
  • 中国光伏展
  • Nacos的统一配置管理
  • SpringBoot项目docker镜像生成
  • JDBC初体验(二)——增、删、改、查
  • Eva.js是什么(互动小游戏开发)
  • 监听 beforeunload 事件,阻止页面刷新导致的信息丢失
  • Java 常见缓存详解以及解决方案
  • Golang 交叉编译之一文详解