ChartControl ViewType.Pie3D 用法测试
效果图一、
public partial class Form3 : Form
{
public Form3()
{
InitializeComponent();
} private void Form3_Load(object sender, EventArgs e)
{
// Create an empty chart.
ChartControl PieChart3D = new ChartControl(); // Create a pie series.
Series series1 = new Series("Pie Series 1", ViewType.Pie3D); //// Populate the series with points.
//series1.Points.Add(new SeriesPoint("Russia", 17.0752));
//series1.Points.Add(new SeriesPoint("Canada", 9.98467));
//series1.Points.Add(new SeriesPoint("USA", 9.63142));
//series1.Points.Add(new SeriesPoint("China", 9.59696));
//series1.Points.Add(new SeriesPoint("Brazil", 8.511965));
//series1.Points.Add(new SeriesPoint("Australia", 7.68685));
//series1.Points.Add(new SeriesPoint("India", 3.28759));
//series1.Points.Add(new SeriesPoint("Others", 81.2)); DataTable dt = new DataTable();
dt.Columns.Add("X轴", Type.GetType("System.String"));
dt.Columns.Add("线①", Type.GetType("System.Int32"));
dt.Columns.Add("线②", Type.GetType("System.Int32"));
dt.Columns.Add("线③", Type.GetType("System.Int32"));
dt.Columns.Add("线④", Type.GetType("System.Int32")); for (int i = ; i < ; i++)
{
Random rd = new Random();
DataRow dr = dt.NewRow();
dr["X轴"] = ("类别" + i.ToString());
dr["线①"] = rd.Next(i * , (i + ) * ); ;
dr["线②"] = rd.Next(i * , (i + ) * );
dr["线③"] = rd.Next(i * , (i + ) * );
dr["线④"] = rd.Next(i * , (i + ) * );
dt.Rows.Add(dr);
}
series1.DataSource = dt;
series1.ArgumentDataMember = "X轴"; //设置公共的X轴值(刻度)
series1.ValueScaleType = ScaleType.Numerical;
//设置 单个Series2 Y轴的(值)
series1.ValueDataMembers.AddRange(new string[] { "线①" }); // Add the series to the chart.
PieChart3D.Series.Add(series1);
//series1.LegendPointOptions.PointView = PointView.ArgumentAndValues;//格式:【类别:百分比】
series1.LegendPointOptions.PointView = PointView.Argument;//格式:【类别】
//series1.LegendPointOptions.PointView = PointView.Values;//格式:【百分比】
//series1.LegendPointOptions.PointView = PointView.SeriesName;//显示series1的Name
//series1.LegendPointOptions.PointView = PointView.Undefined;//显示效果:【百分比】
// Adjust the value numeric options of the series.
//series1.Label.TextPattern = "{VP:P0}"; PieChart3D.Legend.Visible = true; //设置 右边 标注框是否显示
PieChart3D.Legend.TextVisible = true; //设置标注框是否显示 每项目的数值 // Adjust the view-type-specific options of the series.
((Pie3DSeriesView)series1.View).Depth = ;//设置饼的厚度
((Pie3DSeriesView)series1.View).ExplodedPoints.Add(series1.Points[]); //选中一个需要突出的项目
((Pie3DSeriesView)series1.View).ExplodedDistancePercentage = ;//将其中一个项目(SeriesPoint)推出来的距离 // Access the diagram's options.
((SimpleDiagram3D)PieChart3D.Diagram).RotationType = RotationType.UseAngles;
((SimpleDiagram3D)PieChart3D.Diagram).RotationAngleX = -;//设置平面的倾斜度 // Add a title to the chart and hide the legend.
ChartTitle chartTitle1 = new ChartTitle();
chartTitle1.Text = "3D Pie Chart";//设置标题
PieChart3D.Titles.Add(chartTitle1);//添加标题
//PieChart3D.Legend.Visibility = DevExpress.Utils.DefaultBoolean.False; // Add the chart to the form.
PieChart3D.Dock = DockStyle.Fill;
this.Controls.Add(PieChart3D); }
}
效果图二、
public partial class Form3 : Form
{
public Form3()
{
InitializeComponent();
} private void Form3_Load(object sender, EventArgs e)
{
// Create an empty chart.
ChartControl PieChart3D = new ChartControl(); // Create a pie series.
Series series1 = new Series("Pie Series 1", ViewType.Pie3D); // Populate the series with points.
series1.Points.Add(new SeriesPoint("Russia", 17.0752));
series1.Points.Add(new SeriesPoint("Canada", 9.98467));
series1.Points.Add(new SeriesPoint("USA", 9.63142));
series1.Points.Add(new SeriesPoint("China", 9.59696));
series1.Points.Add(new SeriesPoint("Brazil", 8.511965));
series1.Points.Add(new SeriesPoint("Australia", 7.68685));
series1.Points.Add(new SeriesPoint("India", 3.28759));
series1.Points.Add(new SeriesPoint("Others", 81.2)); //DataTable dt = new DataTable();
//dt.Columns.Add("X轴", Type.GetType("System.String"));
//dt.Columns.Add("线①", Type.GetType("System.Int32"));
//dt.Columns.Add("线②", Type.GetType("System.Int32"));
//dt.Columns.Add("线③", Type.GetType("System.Int32"));
//dt.Columns.Add("线④", Type.GetType("System.Int32")); //for (int i = 0; i < 10; i++)
//{
// Random rd = new Random();
// DataRow dr = dt.NewRow();
// dr["X轴"] = ("类别" + i.ToString());
// dr["线①"] = rd.Next(i * 10, (i + 1) * 10); ;
// dr["线②"] = rd.Next(i * 10, (i + 1) * 10);
// dr["线③"] = rd.Next(i * 10, (i + 1) * 10);
// dr["线④"] = rd.Next(i * 10, (i + 1) * 10);
// dt.Rows.Add(dr);
//}
//series1.DataSource = dt;
//series1.ArgumentDataMember = "X轴"; //设置公共的X轴值(刻度)
//series1.ValueScaleType = ScaleType.Numerical;
////设置 单个Series2 Y轴的(值)
//series1.ValueDataMembers.AddRange(new string[] { "线①" }); // Add the series to the chart.
PieChart3D.Series.Add(series1);
series1.LegendPointOptions.PointView = PointView.ArgumentAndValues;//格式:【类别:百分比】
//series1.LegendPointOptions.PointView = PointView.Argument;//格式:【类别】
//series1.LegendPointOptions.PointView = PointView.Values;//格式:【百分比】
//series1.LegendPointOptions.PointView = PointView.SeriesName;//显示series1的Name
//series1.LegendPointOptions.PointView = PointView.Undefined;//显示效果:【百分比】
// Adjust the value numeric options of the series.
//series1.Label.TextPattern = "{VP:P0}"; PieChart3D.Legend.Visible = true; //设置 右边 标注框是否显示
PieChart3D.Legend.TextVisible = true; //设置标注框是否显示 每项目的数值 // Adjust the view-type-specific options of the series.
((Pie3DSeriesView)series1.View).Depth = ;//设置饼的厚度
((Pie3DSeriesView)series1.View).ExplodedPoints.Add(series1.Points[]); //选中一个需要突出的项目
((Pie3DSeriesView)series1.View).ExplodedDistancePercentage = ;//将其中一个项目(SeriesPoint)推出来的距离 // Access the diagram's options.
((SimpleDiagram3D)PieChart3D.Diagram).RotationType = RotationType.UseAngles;
((SimpleDiagram3D)PieChart3D.Diagram).RotationAngleX = -;//设置平面的倾斜度 // Add a title to the chart and hide the legend.
ChartTitle chartTitle1 = new ChartTitle();
chartTitle1.Text = "3D Pie 测试效果图2";//设置标题
PieChart3D.Titles.Add(chartTitle1);//添加标题
//PieChart3D.Legend.Visibility = DevExpress.Utils.DefaultBoolean.False; // Add the chart to the form.
PieChart3D.Dock = DockStyle.Fill;
this.Controls.Add(PieChart3D); }
}
ChartControl ViewType.Pie3D 用法测试的更多相关文章
- chartControl ViewType.Bar 用法测试
使用方法 一. Datatable : chartControl1.Series.Clear(); DataTable dt = new DataTable(); dt.Columns.Add(&qu ...
- php set_time_limit()用法测试详解
在php中set_time_limit函数是用来限制页面执行时间的,如我想把一个php页面的执行时间定义为5秒就可以set_time_limit(5)了. 一个php脚本通过crontab每5分钟 ...
- DevExpress ChartControl ViewType.Line
源码地址:https://files.cnblogs.com/files/lanyubaicl/ChartControl.Line.7z public partial class Form1 : Fo ...
- DevExpress中ChartControl柱状图(Bar)用法
我的数据 代码如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 chartControl1.Series.Clear(); ...
- telnet用法 测试端口号
Telnet是进行远程登录的标准协议和主要方式它为用户提供了在本地计算机上完成远程主机工作的能力.可以用telnet命令来测试端口号是否正常打开还是关闭状态. 工具/原料 电脑 cmd命令 方法/步骤 ...
- python 用法测试
Python 3.5.6 1.js风格的回调测试 def b(): ') def a(fn): if callable(fn): fn() a(b) class Sample: def q(self) ...
- chartControl 饼状图小Demo
Short Description The Pie Chart is represented by the Pie3DSeriesView object, which belongs to P ...
- 关于jQuery.when()用法
1.该方法在jQuery1.5开始被引入. 2.用法测试 a. var url1 = "/resource/ar/hometab/index_tab_games.json", ur ...
- Java 枚举(enum) 详解7种常见的用法
Java 枚举(enum) 详解7种常见的用法 来源 https://blog.csdn.net/qq_27093465/article/details/52180865 JDK1.5引入了新的类型— ...
随机推荐
- Android Studio 调试各种国产手机经验总结
为何加上“国产”二字呢,因为目前测试时就国产手机存在的安装问题多,而且都很奇葩,不得不说对于开发者时很不友好的. 下面就是个人总结的针对不同的机型调试时出现的问题做的总结: 1.VIVO 手机 解决方 ...
- UnicodeDecodeError:utf-8codeccantdecodebyte0xb9inposition0:invalidstartbyte
相信这个问题大家都会以为是编码的问题,当然原本我也以为是编码问题! 然后试了各种方案!都是以失败告终! 哈哈哈,后来解决了,原来真是闹了个大笑话............ 这是因 ...
- 终于明白word-break属性——break-all和break-word的区别
其实一直不明白,也没有认真去想过 word-break 属性的 break-all 和 break-word 有什么区别 后来看了一个大神写的一篇博客,写得很详细,看了豁然开朗. 所以,我也就不在 ...
- Anaconda / Conda 实践
一.环境 CentOS 7.6 有预装 python 2.7 二.Anaconda 与 Conda 区别 1.Anaconda Anaconda 是Python的一种发行版.包含了: (1)conda ...
- Spring整合MyBatis 你get了吗?
Spring整合MyBatis 1.整体架构dao,entity,service,servlet,xml 2..引入依赖 <dependencies> <dependency> ...
- Java核心技术及面试指南 流程控制方面的面试题答案
2.2.5.1 switch语句能否作用在byte上,能否作用在long上,能否作用在String上? 1 switch里可以用char,byte,short,int这些基本类型,以及它们的封装类. ...
- Java多线程之二(Synchronized)
常用API method 注释 run() run()方法是我们创建线程时必须要实现的方法,但是实际上该方法只是一个普通方法,直接调用并没有开启线程的作用. start() start()方法作用为使 ...
- 简易远程消息交换协议SRMP
一.SRMP目标定位 经过十多年实战经验积累以及多方共同讨论,新生命团队(https://github.com/newlifex)制订了一种简单而又具有较好扩展性的RPC(Remote Procedu ...
- 关于kubernetes使用私有仓库一点说明
一.概述 关于kubernetes使用私有docker image registry的一些说明: 1.对于自己构建的项目镜像或一些不想暴露到外网的image需要使用自建的私有仓库,一般有两种选择:d ...
- 痞子衡嵌入式:恩智浦LPC系列MCU开发那些事 - 索引
大家好,我是痞子衡,是正经搞技术的痞子.本系列痞子衡给大家介绍的是恩智浦LPC系列微控制器相关知识. 恩智浦半导体最早于2003年便开始推出LPC系列MCU,但早期的产品LPC2000/3000系列属 ...