学习devexpresschartControl控件
devexpress官网chart:https://documentation.devexpress.com/WindowsForms/8117/Controls-and-Libraries/Chart-Control






XYDiagram diagram = chart.Diagram as XYDiagram;
if (diagram != null) {
// Access diagram properties, for example, rotate the diagram.
diagram.Rotated = true;
// Access properties of objects that belong to the diagram,
// for example, axes and panes.
diagram.AxisY.Title.Text = "Population mid-year, millions";
diagram.DefaultPane.Weight = ;
}
给坐标轴加标题
using System;
using System.Drawing;
using System.Windows.Forms;
using DevExpress.XtraCharts;
// ... private void Form1_Load(object sender, EventArgs e) {
// Create a new chart.
ChartControl chartControl1 = new ChartControl(); // Create two series.
Series series1 = new Series("Series 1", ViewType.Bar);
Series series2 = new Series("Series 2", ViewType.Line); // Add points to them, with their arguments different.
series1.Points.Add(new SeriesPoint("A", ));
series1.Points.Add(new SeriesPoint("B", ));
series1.Points.Add(new SeriesPoint("C", ));
series1.Points.Add(new SeriesPoint("D", ));
series2.Points.Add(new SeriesPoint("I", ));
series2.Points.Add(new SeriesPoint("II", ));
series2.Points.Add(new SeriesPoint("III", ));
series2.Points.Add(new SeriesPoint("IV", )); // Add both series to the chart.
chartControl1.Series.AddRange(new Series[] { series1, series2 }); // Hide the legend (optional).
chartControl1.Legend.Visible = false; // Cast the chart's diagram to the XYDiagram type,
// to access its axes and panes.
XYDiagram diagram = (XYDiagram)chartControl1.Diagram; // Add secondary axes to the diagram, and adjust their options.
diagram.SecondaryAxesX.Add(new SecondaryAxisX("My Axis X"));
diagram.SecondaryAxesY.Add(new SecondaryAxisY("My Axis Y"));
diagram.SecondaryAxesX[].Alignment = AxisAlignment.Near;
diagram.SecondaryAxesY[].Alignment = AxisAlignment.Near; // Add a new additional pane to the diagram.
diagram.Panes.Add(new XYDiagramPane("My Pane")); // Assign both the additional pane and, if required,
// the secondary axes to the second series.
LineSeriesView myView = (LineSeriesView)series2.View;
myView.AxisX = diagram.SecondaryAxesX[];
myView.AxisY = diagram.SecondaryAxesY[];
// Note that the created pane has the zero index in the collection,
// because the existing Default pane is a separate entity.
myView.Pane = diagram.Panes[]; // Customize the layout of the diagram's panes.
diagram.PaneDistance = ;
diagram.PaneLayoutDirection = PaneLayoutDirection.Horizontal;
diagram.DefaultPane.SizeMode = PaneSizeMode.UseWeight;
diagram.DefaultPane.Weight = 1.2; // Add the chart to the form.
chartControl1.Dock = DockStyle.Fill;
this.Controls.Add(chartControl1);
}
add pans

Adding Panes:https://documentation.devexpress.com/WindowsForms/5880/Controls-and-Libraries/Chart-Control/Fundamentals/Chart-Elements/Diagram/Panes/Adding-Panes#Examples
using System;
using System.Drawing;
using System.Windows.Forms;
using DevExpress.XtraCharts;
// ... private void Form1_Load(object sender, EventArgs e) {
// Create a new chart.
ChartControl chartControl1 = new ChartControl(); // Create two series.
Series series1 = new Series("Series 1", ViewType.Bar);
Series series2 = new Series("Series 2", ViewType.Line); // Add points to them, with their arguments different.
series1.Points.Add(new SeriesPoint("A", ));
series1.Points.Add(new SeriesPoint("B", ));
series1.Points.Add(new SeriesPoint("C", ));
series1.Points.Add(new SeriesPoint("D", ));
series2.Points.Add(new SeriesPoint("I", ));
series2.Points.Add(new SeriesPoint("II", ));
series2.Points.Add(new SeriesPoint("III", ));
series2.Points.Add(new SeriesPoint("IV", )); // Add both series to the chart.
chartControl1.Series.AddRange(new Series[] { series1, series2 }); // Hide the legend (optional).
chartControl1.Legend.Visible = false; // Cast the chart's diagram to the XYDiagram type,
// to access its axes and panes.
XYDiagram diagram = (XYDiagram)chartControl1.Diagram; // Add secondary axes to the diagram, and adjust their options.
diagram.SecondaryAxesX.Add(new SecondaryAxisX("My Axis X"));
diagram.SecondaryAxesY.Add(new SecondaryAxisY("My Axis Y"));
diagram.SecondaryAxesX[].Alignment = AxisAlignment.Near;
diagram.SecondaryAxesY[].Alignment = AxisAlignment.Near; // Add a new additional pane to the diagram.
diagram.Panes.Add(new XYDiagramPane("My Pane")); // Assign both the additional pane and, if required,
// the secondary axes to the second series.
LineSeriesView myView = (LineSeriesView)series2.View;
myView.AxisX = diagram.SecondaryAxesX[];
myView.AxisY = diagram.SecondaryAxesY[];
// Note that the created pane has the zero index in the collection,
// because the existing Default pane is a separate entity.
myView.Pane = diagram.Panes[]; // Customize the layout of the diagram's panes.
diagram.PaneDistance = ;
diagram.PaneLayoutDirection = PaneLayoutDirection.Horizontal;
diagram.DefaultPane.SizeMode = PaneSizeMode.UseWeight;
diagram.DefaultPane.Weight = 1.2; // Add the chart to the form.
chartControl1.Dock = DockStyle.Fill;
this.Controls.Add(chartControl1);
}
How to: Display a Series in an Additional Pane (Runtime Sample)

学习devexpresschartControl控件的更多相关文章
- Delphi 7学习开发控件
我们知道使用Delphi快速开发,很大的一方面就是其强大的VCL控件,另外丰富的第三方控件也使得Delphi程序员更加快速的开发出所需要的程序.在此不特别介绍一些概念,只记录自己学习开发控件的步骤.假 ...
- 过实现鹰眼图这个功能来进一步学习MapControl控件
我们通过实现鹰眼图这个功能来进一步学习MapControl控件.在实现鹰眼图之前,我们需 要接口有更深入的了解. 变主动为被动-出接口(OutBound interface) COM编程类似客户端和服 ...
- Expression Blend学习四控件
原文:Expression Blend学习四控件 Expression Blend制作自定义按钮 1.从Blend工具箱中添加一个Button,按住shift,将尺寸调整为125*125; 2.右键点 ...
- Expression Blend学习5控件
原文:Expression Blend学习5控件 Expression Blend ButtonStyle- TextButton 本章以TextButton为例,讲解如何最简单,最快速的制作一个专业 ...
- Delphi 7学习开发控件(继承TGraphicControl只画一条线)
我们知道使用Delphi快速开发,很大的一方面就是其强大的VCL控件,另外丰富的第三方控件也使得Delphi程序员更加快速的开发出所需要的程序.在此不特别介绍一些概念,只记录自己学习开发控件的步骤.假 ...
- 安卓开发_深入学习ViewPager控件
一.概述 ViewPager是android扩展包v4包(android.support.v4.view.ViewPager)中的类,这个类可以让用户左右切换当前的view. ViewPager特点: ...
- Android Studio 学习 - 基本控件的使用;Intent初学
Android Studio学习第三天. 今天主要学习 1. RadioButton.CheckBox.RatingBar.SeekBar等基础控件的使用. 结合Delphi中相类似的控件,在这些基本 ...
- 学习webView控件使用
WebView 对象用于网页显示使用,简单的学习并使用了一下. 1.首先在 layout 中摆一个全屏的 webview 控件 (main.xml ) <?xml version="1 ...
- android 学习 Spinner控件的使用
今晚看了下spinner控件的使用,结合博客大神的教程,一个小demo 一,SpinnerActivity private Spinner spinner; private ArrayAdapter& ...
随机推荐
- Python: 定时器(Timer)简单实现
项目分析中发现有网站下载过程中需要发送心跳指令,复习下定时器,其与javascript中实现方法类似. 其原理为执行函数中置定时函数Timer(),递归调用自己,看来实现方法比较拙劣. 假定1秒触发一 ...
- QQ分享登陆报错
linker command failed with exit code 1 (use -v to see invocation)报错原因 builtSetting下搜索 bitco 改为NO
- go语言sync包的学习(Mutex、WaitGroup、Cond)
package main; import ( "fmt" "sync" "runtime" "time" ) //加锁, ...
- iOS | 使用HBuilder进行云端打包步骤
1.先在HBuilder本地项目中的Manifest.json文件中进行项目配置,将应用的图标和启动图,按照固定的尺寸进行配置.设置应用名称,版本号, 这里的appid不需要修改,是HBuilder自 ...
- 无法连接到localhost.其他信息:用户“sa”登录失败。(MicroSoft Sql Server,错误:18456)
18456错误: 在安装的时候如果选择的身份验证模式为:Window身份验证模式,就会出现18456的错误. 解决方案: 使用windows身份验证登录之后,在下面红框上单击右键,点击属性: 点击属性 ...
- laravel中不使用 remember_token时退出报错,如何解决?
Route::get('auth/logout','Auth\AuthController@getLogout'); 这是laravel自带的退出功能只需要写这一条路由就行了,但是很可能爆出以下错误: ...
- springBoot整合Quarzt2.3
首先,你要配置好springboot的配置(在resources下) 我把其改为application.yml # Tomcat server: tomcat: uri-encoding: UTF-8 ...
- 如何快速学好Shell脚本?
Shell 语言作为类 Unix 系统的原生脚本,有着非常实用的价值.但对于很多刚刚接触 Shell 脚本的同学来说,搞懂 Shell 语言的语法却是一件非常困难的事情.甚至有人吐槽,或许没有谁能清楚 ...
- 设计师们做UI设计和交互设计、界面设计等一般会去什么网站呢?
明明可靠颜值吃饭,却偏偏要靠才华立身,UI设计师就是这样一群神奇的物种.面对“大的同时小一点”.“五彩斑斓黑”.“下班之前给我”……这些甲方大大刁钻的需求,设计师每天都在咬牙微笑讨生活.你可以批评我的 ...
- java连接数据库以及连接参数格式
//链接数据库代码部分 下面具有连接的基本参数可以对照修改(参数存放在file下面的database.properties下面) //参数存放在file下面的database.properties下 ...