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 = "
DevExpress之ChartControl实现时间轴实例 z
最新推荐文章于 2021-01-08 14:23:01 发布
本文介绍了DevExpress ChartControl在处理大数据量时的性能优化策略,包括关闭不必要的可视化元素、禁止滚动缩放、调整RefreshDataOnRepaint属性、启用CacheToMemory缓存以及禁用RuntimeHitTesting以提升重绘速度。
摘要由CSDN通过智能技术生成