Hi everyone,
I have the following problem with my chart :
I have 4 datas, the value on axis X is DateTime and the value on axis Y is double.
My datas are the following :
2010-03-16T16:56:40 (startTime variable) : 2.21
2010-04-16T17:04:40 : 2.51
2010-05-01T17:04:10 : 3.16
2010-05-16T17:03:10 (endTime variable) : 4.23
My chart configuration is the following :
SeriesMapping valueMapping = new SeriesMapping();
valueMapping.ItemMappings.Add(new ItemMapping("Date", DataPointMember.XValue));
valueMapping.ItemMappings.Add(new ItemMapping("M", DataPointMember.YValue));
valueMapping.SeriesDefinition = new LineSeriesDefinition();
Chart.SeriesMappings.Add(valueMapping);
Chart.DefaultView.ChartTitle.Content = "M";
Chart.DefaultView.ChartArea.AxisY.AutoRange = false;
Chart.DefaultView.ChartArea.AxisY.AddRange(0, 5, 0.5);
Chart.DefaultView.ChartArea.AxisY.Title = "M values";
Chart.DefaultView.ChartArea.AxisX.AutoRange=falseChart.DefaultView.ChartArea.AxisX.MajorGridLinesVisibility = Visibility.Visible;
Chart.DefaultView.ChartArea.AxisX.IsDateTime = true;
Chart.DefaultView.ChartArea.AxisX.DefaultLabelFormat = "MMM/yy";
Chart.DefaultView.ChartArea.AxisX.LabelRotationAngle = 270;
Chart.DefaultView.ChartArea.ZoomScrollSettingsX.ScrollMode = ScrollMode.ScrollAndZoom;
Chart.DefaultView.ChartArea.AxisY.MajorGridLinesVisibility = Visibility.Visible;
Chart.DefaultView.ChartArea.AxisY.MinorGridLinesVisibility = Visibility.Visible;
Chart.DefaultView.ChartArea.AxisY.StripLinesVisibility = Visibility.Collapsed;
Chart.ItemsSource = dt;
Chart.DefaultView.ChartArea.AxisX.MinValue = startTime.ToOADate();
Chart.DefaultView.ChartArea.AxisX.MaxValue = endTime.ToOADate();
double step = startTime.AddYears(1).ToOADate() - startTime.ToOADate();
System.Diagnostics.Debug.WriteLine(step);
Chart.DefaultView.ChartArea.AxisY.AddRange(startTime.ToOADate(), endTime.ToOADate(), step);
when I start my application, no data appears and I have the "No Dataseries" but with auto-range it's working.