We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Shapes.AddClone Returns Incorrect Object Type

When doing a Shapes.AddClone of a chart type, the return object in some cases is different from the object we are cloning. returns a pictureframe object.
Here are all the ChartTypes that are returning a PictureFrame object type when cloned.
Treemap, Sunburst, Histogram, BoxAndWhisker, Waterfall, Funnel, Map

using Aspose.Slides.Net - version 22.7

            private void button1_Click(object sender, EventArgs e)
            {
                textBox1.Text = "";
                StringBuilder sbInvalidCharts = new StringBuilder();
                Presentation presentation = new Presentation();
                ISlide slides = presentation.Slides[0];

                foreach (ChartType _charttype in Enum.GetValues(typeof(ChartType)))
                {
                    try
                    {
                        IChart tmpchart = slides.Shapes.AddChart(_charttype, 100, 100, 400, 400);

                        IShape cloneShape = slides.Shapes.AddClone(tmpchart);

                        if (cloneShape.GetType() != typeof(Aspose.Slides.Charts.Chart))
                        {
                            sbInvalidCharts.AppendLine($"{_charttype.ToString()}        {cloneShape.GetType()}");
                        }
                    }
                    catch (Exception ex)
                    {
                        var error = ex.Message;
                        continue;
                    }
                }

                textBox1.Text = (sbInvalidCharts.ToString());

            }

@agollamandala,
Thank you for contacting support. I am checking the issue you described. We will reply to you soon.

@agollamandala,
I’ve reproduced the problem with clonning the charts and added a ticket with ID SLIDESNET-43344 to our issue tracking system. We apologize for any inconvenience. You will be notified when the issue is resolved.