Stacked bar (and column) charts end up with staggered series

I want to create stacked bar charts with multiple series. The usual expectation for such charts is that each serie is stacked on top of the other series, along the same horizontal line. However, I’m finding that the series end up staggered next to each other instead. See the attached PowerPoint with illustrations. The first slide shows the problem I’m experiencing. The second slide shows more or less the result I want to see (I created this by converting the chart to stacked percentage, but the series stacking is the same).


For this example, I’m using the sample code from this page:
Create or Update PowerPoint Presentation Charts in C# or .NET|Aspose.Slides Documentation

I only made the following change:
Instead of
// Add chart with default data
IChart chart = sld.Shapes.AddChart(ChartType.ClusteredColumn, 0, 0, 500, 500);

I used
IChart chart = sld.Shapes.AddChart(ChartType.StackedBar, 0, 0, 500, 500);

Hopefully I’m missing something very obvious here, so I would very much appreciate some guidance.

Hi Steven,

I have worked over the scenario shared by you and like to share that Aspose.Slides is creating a stacked column or bar chart. However, the issue is that when generating the chart the default series overlapping option is not set to 100. I have explored the property and have found that it is presently unavailable. I have added an issue as new feature request with ID SLIDESNET-35663 in our issue tracking system to add the requested support. For the time being, I request you to please try setting the series overlap to 100 to get exact overlap of series using PowerPoint. I am also in contact with our development team for this feature and will share the feedback with you as soon as it will be shared by our development team.

Many Thanks,

Hi

Many thanks for investigating.

If I understand your conclusion correctly, this effectively means that for practical purposes, stacked bar charts and stacked column charts are not supported or available through Aspose.Slides? A stacked chart can technically be created, but if the series are not stacked and in-line, then that is ususally not what someone is looking for. I know we can fix this manually through PowerPoint, but when automating hundreds of reports…

This sounds like a pretty serious omission, so hopefully it will get fixed soon…?!

Regards,
Steven

Hi Steven,


I agree with your point of view and will share the good news with you as soon as the issue will be resolved.

Many Thanks,

Can you please fix this quickly?

We are considering buying aspose but as this stacking option is not working this is not an option!

N.B. StackedColumn3D and all other stacked3D types do work as aspected, so i can’t be real difficult to fix this is suspose.

Hi Juri,

I have requested the development team to share an ETA regarding this feature. As soon as I get the information, I will update you via this forum thread.

Thanks & Regards,

solved it myself, turn out i had to set the overlap of the series to 100.


Thanks for the support

Hi tuijl,


I am facing the same issue, Can you please share with me the piece of code to help me out?

However, as I can see, Overlap property of IChartSeries instance is read only.How did you manage to fix it yourself?

Thanx in advance.

Hi Tuijl,

Thanks for inquiring Aspose.Slides.

I have observed your requirement and request you to please try using the following sample code on your end to verify the supported feature.

IChart chart = pres.Slides[0].Shapes.AddChart(ChartType.ClusteredColumn, 50, 50, 600, 400, true);
IChartSeriesCollection series = chart.ChartData.Series;
if (series[0].Overlap == 0)
{
series[0].ParentSeriesGroup.Overlap = -30;
}

Many Thanks,