This example demonstrates how to set up a range control with the date-time chart client to display a chart with date-time data in the range control's background.
In order to provide data to a chart date-time range control client, you need to access the ChartRangeControlClientDataProvider object using the ChartRangeControlClientBase.DataProvider property and assign a data source to the ChartRangeControlClientDataProvider.DataSource property. Then specify the required data fields via the ChartRangeControlClientDataProvider.ArgumentDataMember, ChartRangeControlClientDataProvider.ValueDataMember, and ChartRangeControlClientDataProvider.SeriesDataMember (optional) properties.
In the current example, a date-time chart client is bound to a simple data table containing three columns ("Argument", "Value", and "Series").
In addition, this example shows how to customize chart client common settings (e.g., change the date-time range, customize template view and grid options).
Question Comments
Added By: Al Dyachkov at: 8/20/2014 3:08:54 PM
There is an error in this sample
This part sets fixed range,
// Change the date-time range of the chart range control client.
dateTimeChartRangeControlClient1.Range.Min = new DateTime(2014, 7, 6);
dateTimeChartRangeControlClient1.Range.Max = new DateTime(2014, 7, 28);
while data generation uses DateTime.Now
row["Argument"] = DateTime.Now.Date.AddDays(pointIndex);
The code should be something like this :
// Change the date-time range of the chart range control client.
dateTimeChartRangeControlClient1.Range.Min = DateTime.Now;
dateTimeChartRangeControlClient1.Range.Max = DateTime.Now.AddDays(50);
Hi Al,
Thank you for the remark. We have corrected the example.
Added By: Samson Bassett at: 9/3/2014 2:47:23 PM
Just wanted to thank you, as the DX docs are pretty terrible and this helped me a ton.
One error you have though is this
'DevExpress.XtraEditors.RangeControlDateTimeGridAlignment' is a 'type' but is used like a 'variable'
Perhaps you meant something like this
dateTimeChartRangeControlClient1.GridOptions.SnapAlignment = DevExpress.XtraEditors.RangeControlDateTimeGridAlignment.Day;
Added By: Alexander T (DevExpress) at: 9/4/2014 1:42:48 AMHello Samson,
The example works correctly on my side. Would you please create a separate ticket for your issue and upload a sample project there?
We will be glad to help you.