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.