Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2009
StackColumn Chart - Two series not showing all data points
posted

Hi,

 I am using StackColumn chart having two series in it. When I plot only one series, all data points show up. But when I use two series, the same series does not show all the data points.

To illustrate, I have attached the two pictures - one with only 1 series showing all 4 data points, and other picture with 2 series but now the 4th data point from the same series is missing. Please find the code also  below.


myInfraChart.ChartType = ChartType.StackColumnChart;
       
/// Series 1. When alone this series gives all data points. But together, 4th data point with value 10 is missing from the chart
NumericSeries num1Series = new NumericSeries();
num1Series.Points.Add(new NumericDataPoint(Convert.ToDouble(1), "B", false));
num1Series.Points.Add(new NumericDataPoint(Convert.ToDouble(2), "B", false));
num1Series.Points.Add(new NumericDataPoint(Convert.ToDouble(3), "B", false));
num1Series.Points.Add(new NumericDataPoint(Convert.ToDouble(4), "B", false));
myInfraChart.Series.Add(num1Series);

/// Series 2
NumericSeries num2Series = new NumericSeries();
num2Series.Points.Add(new NumericDataPoint(Convert.ToDouble(1), "A", false));
num2Series.Points.Add(new NumericDataPoint(Convert.ToDouble(2), "A", false));
num2Series.Points.Add(new NumericDataPoint(Convert.ToDouble(3), "A", false));
myInfraChart.Series.Add(num2Series);

/// Set Range
myInfraChart.Axis.Y.RangeType = AxisRangeType.Custom;
myInfraChart.Axis.Y.RangeMin = 0;
myInfraChart.Axis.Y.RangeMax = 15;
myInfraChart.Axis.Y.TickmarkStyle = AxisTickStyle.DataInterval;
myInfraChart.Axis.Y.TickmarkInterval = 1;
myInfraChart.Axis.Y.Visible = true;

Please let me know what I am missing.

Thanks.

StackColumn_Data Point missing.zip