Search code examples
c#dotnetcharting

Dotnetcharting stacked bar chart displaying like regular bar chart


I have a dotnetcharting chart that I want to display as a Stacked Bar chart, but when it actually displays it shows up as a regular bar chart with the bars next to each other. I have Chart.YAxis.Scale = Scale.Stacked; and I checked and it is getting set properly. Does anyone know why it isn't working properly?


Solution

  • I found that if you create a new Axis for a Series you have to change the Series's Axis and not the Chart's Axis. So what I needed to do was: timeLossStackedBarChart.SeriesCollection[0].YAxis.Scale = Scale.Stacked;