没有合适的资源?快使用搜索试试~ 我知道了~
DevExpress之ChartControl实现时间轴实例
5星 · 超过95%的资源 40 下载量 181 浏览量
2020-09-04
02:34:34
上传
评论
收藏 83KB PDF 举报
温馨提示
试读
4页
主要介绍了DevExpress中ChartControl实现时间轴的方法,涉及相关C#绘图程序用法,具有一定的实用价值,需要的朋友可以参考下
资源推荐
资源详情
资源评论
DevExpress之之ChartControl实现时间轴实例实现时间轴实例
主要介绍了DevExpress中ChartControl实现时间轴的方法,涉及相关C#绘图程序用法,具有一定的实用价值,需要
的朋友可以参考下
本文实例讲述了DevExpress采用ChartControl实现时间轴的方法,分享给大家供大家参考。具体实现方法如下:
关键代码如下:
复制代码 代码如下:
using System;
using System.Data;
using System.Windows.Forms;
using DevExpress.XtraCharts;
namespace DevExpressChart
{
public partial class winDateTime : Form
{
public winDateTime()
{
InitializeComponent();
}
private void winDateTime_Load(object sender, EventArgs e)
{
BuilderDevChart();
}
private DataTable CreateChartData()
{
DataTable table = new DataTable("Table1");
table.Columns.Add("Date", typeof(DateTime));
table.Columns.Add("Value", typeof(Int32));
table.Rows.Add(new object[] { new DateTime(2014, 5, 21), 10 });
table.Rows.Add(new object[] { new DateTime(2014, 6, 22), 20 });
table.Rows.Add(new object[] { new DateTime(2014, 7, 23), 40 });
table.Rows.Add(new object[] { new DateTime(2014, 8, 24), 20 });
table.Rows.Add(new object[] { new DateTime(2014, 9, 25), 30 });
return table;
}
private void BuilderDevChart()
{
Series _lineSeries = new Series("利润", ViewType.Line);
_lineSeries.ArgumentScaleType = ScaleType.DateTime;
_lineSeries.ArgumentDataMember = "Date";
_lineSeries.ValueDataMembers[0] = "Value";
_lineSeries.DataSource = CreateChartData();
chartControl1.Series.Add(_lineSeries);
chartControl1.SetTimeAxisX(DateTimeMeasurementUnit.Month, DateTimeMeasurementUnit.Month, "yyyy-MM");
//---------------------------------------------------------------
//_lineSeries.ValueScaleType = ScaleType.DateTime;
//_lineSeries.ArgumentDataMember = "Value";
//_lineSeries.ValueDataMembers[0] = "Date";
//_lineSeries.DataSource = CreateChartData();
//chartControl1.Series.Add(_lineSeries);
//XYDiagram _diagram = (XYDiagram)chartControl1.Diagram;
//_diagram.AxisY.DateTimeMeasureUnit = DateTimeMeasurementUnit.Month;
//_diagram.AxisY.DateTimeGridAlignment = DateTimeMeasurementUnit.Month;
//_diagram.AxisY.DateTimeOptions.Format = DateTimeFormat.Custom;
//_diagram.AxisY.DateTimeOptions.FormatString = "MMMM";
}
}
}
复制代码 代码如下:
资源评论
- thebestuzi2023-07-26虽然文章并没有提供高级或者复杂的时间轴实现方式,但是对于初学者来说已经足够,能够快速入门并尝试实现自己的时间轴需求。
- 士多霹雳酱2023-07-26这个文件提供了详细的关于DevExpress的ChartControl如何实现时间轴的实例,对想要学习这方面知识的人来说很有帮助。
- 莉雯Liwen2023-07-26文中对于时间轴实现的步骤和代码示例都讲解得很清楚,能够让读者轻松理解并应用到自己的项目中。
- 图像车间2023-07-26这篇文章从实际应用的角度讲解,没有过多的理论概念,对于需要立即实践的读者来说非常实用。
- 赵伊辰2023-07-26文件中的例子很实用,能够很好地帮助开发人员快速上手使用ChartControl实现时间轴功能。
weixin_38690545
- 粉丝: 4
- 资源: 927
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功