Hi..
I'm trying to bind 1 datasource and add another series programmatically.
But my code to add new series does not show up. If I remove the datasource it does.
What's wrong with this? thx!
SQL = "SELECT * TEMP_HUMID_ANALYSIS ";
this.chartTEMP_HUMID.DataSource = new SqlDataSource(DC.Connection.ConnectionString, SQL);
// THIS WORKS
// THIS DOES NOT nothing.. if I remvoe the above it works
// Red Series
ChartSeries serie1 = new ChartSeries();
serie1.Name = "Red";
serie1.Type = ChartSeriesType.Area;
serie1.YAxisType = ChartYAxisType.Secondary;
serie1.Appearance.Border.Visible = false;
serie1.Appearance.FillStyle.FillType = Telerik.Reporting.Charting.Styles.FillType.Hatch;
serie1.Appearance.FillStyle.MainColor = System.Drawing.Color.Red;
serie1.Appearance.LegendDisplayMode = ChartSeriesLegendDisplayMode.SeriesName;
Telerik.Reporting.Charting.ChartSeriesItem item = new Telerik.Reporting.Charting.ChartSeriesItem();
item.XValue = 70;
item.YValue = 0;
serie1.AddItem(item);
item = new Telerik.Reporting.Charting.ChartSeriesItem();
item.XValue = 68.7;
item.YValue = 82;
serie1.AddItem(item);
item = new Telerik.Reporting.Charting.ChartSeriesItem();
item.XValue = 80;
item.YValue = 55;
serie1.AddItem(item);
item = new Telerik.Reporting.Charting.ChartSeriesItem();
item.XValue = 83.3;
item.YValue = 0;
serie1.AddItem(item);
this.chartTEMP_HUMID.Series.Add(serie1);
I'm trying to bind 1 datasource and add another series programmatically.
But my code to add new series does not show up. If I remove the datasource it does.
What's wrong with this? thx!
SQL = "SELECT * TEMP_HUMID_ANALYSIS ";
this.chartTEMP_HUMID.DataSource = new SqlDataSource(DC.Connection.ConnectionString, SQL);
// THIS WORKS
// THIS DOES NOT nothing.. if I remvoe the above it works
// Red Series
ChartSeries serie1 = new ChartSeries();
serie1.Name = "Red";
serie1.Type = ChartSeriesType.Area;
serie1.YAxisType = ChartYAxisType.Secondary;
serie1.Appearance.Border.Visible = false;
serie1.Appearance.FillStyle.FillType = Telerik.Reporting.Charting.Styles.FillType.Hatch;
serie1.Appearance.FillStyle.MainColor = System.Drawing.Color.Red;
serie1.Appearance.LegendDisplayMode = ChartSeriesLegendDisplayMode.SeriesName;
Telerik.Reporting.Charting.ChartSeriesItem item = new Telerik.Reporting.Charting.ChartSeriesItem();
item.XValue = 70;
item.YValue = 0;
serie1.AddItem(item);
item = new Telerik.Reporting.Charting.ChartSeriesItem();
item.XValue = 68.7;
item.YValue = 82;
serie1.AddItem(item);
item = new Telerik.Reporting.Charting.ChartSeriesItem();
item.XValue = 80;
item.YValue = 55;
serie1.AddItem(item);
item = new Telerik.Reporting.Charting.ChartSeriesItem();
item.XValue = 83.3;
item.YValue = 0;
serie1.AddItem(item);
this.chartTEMP_HUMID.Series.Add(serie1);