public class ChartData {
public CallData(DateTime dt, int d, int y) {
XValue = d; YValue = y; ateX = dt;
}
public double DateOA { get { return DateX.ToOADate(); } }
public DateTime DateX { get; set; }
public int XValue { get; set; }
public int YValue { get; set; }
}
When I databind the itemsource of the chart to the QueryViewCollection Object and bind to a SeriesMappingCollection which I initialize so:
SummaryChartSMC = new SeriesMappingCollection();
LineSeriesDefinition lsd = new LineSeriesDefinition() {ShowItemLabels = false, ShowPointMarks = false};
SeriesMapping sm = new SeriesMapping();
sm.CollectionIndex = 0;
sm.SeriesDefinition = bsd;
sm.ItemMappings.Add(new ItemMapping("DateOA",DataPointMember.XValue));
// Also tried:sm.ItemMappings.Add(new ItemMapping("DateX",DataPointMember.XValue));
sm.ItemMappings.Add(new ItemMapping("YValue", DataPointMember.YValue));
sm.ChartArea = new ChartArea();
sm.ChartArea.AxisX.IsDateTime = true;
sm.ChartArea.ZoomScrollSettingsX.MinZoomRange = 1;
sm.ChartArea.AxisX.MinValue = DateTime.Now.AddHours(-12).ToOADate();
sm.ChartArea.AxisX.MaxValue = DateTime.Now.AddHours(+12).ToOADate();
SummaryChartSMC.Add(sm);
I get the "No Data Series" message in my chart.
I know the rest it work because If I use
sm.ItemMappings.Add(new ItemMapping("XValue", DataPointMember.XValue));
and DONT do the IsDateTime and the Axis MinZoomRange and Min/max Value etc, the charts shows up fine.
I think I am missing some anyone see what I am doing wrong?
thanks,
Jas