学习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& ...
随机推荐
- Springboot学习03-SpringMVC自动配置
Springboot学习03-SpringMVC自动配置 前言 在SpringBoot官网对于SpringMVCde 自动配置介绍 1-原文介绍如下: Spring MVC Auto-configur ...
- 阿里云视频直播API签名机制源码
阿里云视频直播API签名机制源码 本文展示:通过代码实现下阿里视频直播签名处理规则 阿里云视频直播签名机制,官方文档链接:https://help.aliyun.com/document_detail ...
- swift - 接入听云监测 - 问题
1. 正常下载 探针SDK:https://report.tingyun.com/mobile-web/#/onlyHeader/sdkDownload 2.按步骤接入 ,添加库啊,什么的URLSc ...
- Java_9 面向对象
1.面向对象思想 面向过程的思想:自己做什么 面向对象的思想:自己找谁做,即不断地创造对象.使用对象.指挥对象做事情.万物皆对象. 面对对象的特征:封装.继承.多态. 2.java中基本单元类 成员变 ...
- spring+quartz报错:Table 'XXXX.QRTZ_TRIGGERS' doesn't exist
Spring4.3.4 + quartz2.2.1配置到application.xml中 <properties> <spring.version>4.3.4.RELEASE& ...
- 关于界面绘制过程多次回调ondraw()方法产生的问题
最近项目中,出现一个问题,要做成的效果是这样的,但是一进去就变成这样了, 后来发现,刚进去是正常的,一闪而过,就变成全部了. 界面绘制过程,ondraw() 会被多次回调. 就是说在第一次绘制的时候是 ...
- mysql乐观锁总结和实践(二)
一篇文章<MySQL悲观锁总结和实践>谈到了MySQL悲观锁,但是悲观锁并不是适用于任何场景,它也有它存在的一些不足,因为悲观锁大多数情况下依靠数据库的锁机制实现,以保证操作最大程度的独占 ...
- node.js中module模块的理解
node.js中使用CommonJS规范实现模块功能,一个单独的文件就是一个单独的模块.通过require方法实现模块间的依赖管理. 通过require加载模块,是同步操作. 加载流程如下: 1.找到 ...
- Django——模板语言相关内容
Django模板语言相关内容 Django模板系统 官方文档 常用语法 只需要记两种特殊符号: {{ }}和 {% %} 变量相关的用{{}},逻辑相关的用{%%}. 变量 {{ 变量名 }} ...
- Windows服务安装、卸载、启动和关闭的管理器
最近在重构公司的系统,把一些需要独立执行.并不需要人为关注的组件转换为Windows服务,Windows服务在使用的过程中有很多好处,相信这一点,就不用我多说了.但是每次都要建立Windows服务项目 ...