Free Support Forum - aspose.com

When updating a bubble chart by assigning string values, values assigned to the XValue property are not being reflected in the thumbnail

I am updating a bubble chart programmatically. When assigning string values to the XValue.Data, YValue.Data, and BubbleSize.Data properties and then using slide.GetThumbnail(), the X axis values for the bubble chart are not being honored. Instead, each item in the series is assigned an incremental value starting at 1. So if you have three items, the bubbles will appear on the X-Axis at 1, 2, & 3. Meanwhile, the Y-axis and BubbleSize of each item is rendered appropriately. Note that if you use Decimal or Integer values to assign to position & size of the bubbles, everything works fine. While I’m happy to have found a workaround, it did cost me a good bit of extra debugging time :slight_smile: Also note that if you assign strings to the X-Axis and then save to PPTX, the chart renders fine when opened in PowerPoint, it is only the thumbnail which seems to exhibit the issue.

Charts.zip (66.3 KB)

    public class ExistingChart
    {
        public static void Run()
        {
            string dataDir = RunExamples.GetDataDir_Charts();
            Presentation pres = new Presentation(dataDir + "ExistingBubbleChart.pptx");

            ISlide sld = pres.Slides[0];
            IChart chart = (IChart)sld.Shapes[1];
            int defaultWorksheetIndex = 0;
            IChartDataWorkbook fact = chart.ChartData.ChartDataWorkbook;

            fact.GetCell(defaultWorksheetIndex, 1, 0, "Modified Category 1");
            fact.GetCell(defaultWorksheetIndex, 2, 0, "Modified Category 2");

            IChartSeries series = chart.ChartData.Series[0];

            fact.GetCell(defaultWorksheetIndex, 0, 1, "New_Series1");// Modifying series name
            series.DataPoints[0].XValue.Data = "90";
            series.DataPoints[0].YValue.Data = "123";
            series.DataPoints[0].BubbleSize.Data = "5";
            series.DataPoints[1].XValue.Data = "3";
            series.DataPoints[1].YValue.Data = "44";
            series.DataPoints[1].BubbleSize.Data = "7";
            series.DataPoints[2].XValue.Data = "30";
            series.DataPoints[2].YValue.Data = "45";
            series.DataPoints[2].BubbleSize.Data = "2";


            var bmp = sld.GetThumbnail(1f, 1f);
            bmp.Save(dataDir + "AsposeChartModified_out.png", ImageFormat.Png);

            pres.Save(dataDir + "AsposeChartModified_out.pptx", SaveFormat.Pptx);
            //ExEnd:ExistingChart
        }
    }

@scottwi,

I have worked with presentation file shared by you and have been able to observe the issue specified. An issue with ID SLIDESNET-40057 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.

The issues you have found earlier (filed as SLIDESNET-40057) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by mudassir.fayyaz

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan