Hi all,
Just getting into this product, so please be gentle ;-)
I have a chart control, with 2 series added. The data source for both series is the same, with three correctly populated columns - one for the X axis (date) and the other two for the series (Y values). I confirm the dataset (dsDash) contains the correct values.
When the chart is displayed, both series display the same data. I think I have hooked everything up OK. When I inspect the Rows property of the Series, they each have the same 3-valued rows, but it seems both series plot with only one of the fields (i.e. they plot the same, overlapping, data). I confirmed each row contains the three correct and different fields/values, and these match up to the dataset.
private void InitialiseChartDataDash()
{
chartControl1.Indexed = false;
modelDash = new ChartDataBindModel(dsDash, "RTReadings");
modelDash.XName = "DateTime";
modelDash.YNames = new String[] { "ImportWh", "ExportWh" }; // These match the fields in the datasource/model
ChartSeries seriesImp = new();
seriesImp.Name = "Import Wh";
seriesImp.Type = ChartSeriesType.Line;
seriesImp.Text = seriesImp.Name;
seriesImp.SeriesModel = modelDash;
ChartSeries seriesExp = new();
seriesExp.Name = "Export Wh";
seriesExp.Type = ChartSeriesType.Spline;
seriesExp.Text = seriesExp.Name;
seriesExp.SeriesModel = modelDash;
chartControl1.Series.Add(seriesImp);
chartControl1.Series.Add(seriesExp);
// X Axis
chartControl1.PrimaryXAxis.Title = "Date/Time";
chartControl1.PrimaryXAxis.ValueType = ChartValueType.DateTime;
chartControl1.PrimaryXAxis.DateTimeRange = new ChartDateTimeRange(DateTime.Today, DateTime.Now, 1, ChartDateTimeIntervalType.Auto);
// Y Axis
chartControl1.PrimaryYAxis.AutoSize = true;
chartControl1.PrimaryYAxis.ValueType = ChartValueType.Double;
Sorry for the in-line code. I can't find a code block thingy here :(
There seems to be some nuance I'm not picking up regarding how the series map to the datasource's fields. If anyone could share some light on this I would be most appreciative.
Cheers,
Mark.