Issue with Data Label Borders in Charts – PPTX File Attached for Review

Hi Aspose Team,

I’ve encountered an issue where data labels in charts begin to show borders unexpectedly under certain conditions. Specifically, this happens when:

  • Saving the file after making changes
  • Duplicating a slide
  • Copying a chart and pasting it into another slide

To help you reproduce and investigate the issue, I’ve attached a sample PPTX file. Kindly test it on your end and let me know if there’s a solution or workaround for this use case.

Looking forward to your support.
aaaaaa.7z (36.0 KB)

Regards,
Manikandan

@Mani.niq

Hello Manikandan,

I understand that you are encountering unexpected borders on data labels in charts within your PPTX file after actions such as saving, duplicating slides, or copying charts. Here are some steps to help troubleshoot this issue:

  1. Check Chart Properties: Verify that the properties for the data labels are configured correctly. Borders may be enabled by default or due to specific settings in the chart.

  2. Update Aspose.Slides: Ensure you are using the latest version of Aspose.Slides. Updates often include bug fixes and enhancements that could resolve your issue.

  3. Recreate the Chart: If the issue persists, consider recreating the chart from scratch on a new slide. This can help determine if the problem is specific to the original chart or the slide itself.

  4. Review Known Issues: Look through the Aspose.Slides documentation or community forums for any known issues related to data label borders. There may be specific workarounds or solutions available.

If these steps do not resolve the issue, please provide additional details about the specific conditions under which the borders appear, and I will be happy to assist you further.

Best regards!

Hi @Professionalize.Discourse

  1. Check Chart Properties : I verified that there is no difference in the chart properties after the modification/copy/duplication of the slide.
    I request to test from your side also, I attached the file for your review.
  2. Update Aspose.Slides : We are using aspose slides 25.6 version
  3. Recreate the Chart If i create the chart manually then not an issue. We need your support creating the chart from aspose slide program.
    You can read the attached file and try to fix from the new sample program.
  4. I don’t find exact review for these issues from aspose community .

@Mani.niq,
Thank you for the sample presentation file. Could you please share a code example to reproduce the issues you described?

Hi @andrey.potapov

Due to the large size of the Java files involved, I’m unable to share the complete code at this time. However, I’ve attached a sample PPTX that you can refer to for context.

Could you please help by creating a standalone code snippet that generates a chart? Additionally, when duplicating the slide, the chart data labels should appear without a border. This would greatly help me understand the issue better and move forward with a solution.

Thank you for your support.

Best regards,
Manikandan Chinnasamy

@Mani.niq,
We have opened the following new ticket(s) in our internal issue tracking system and will provide the code example according to the terms mentioned in Free Support Policies.

Issue ID(s): SLIDESJAVA-39735

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@Mani.niq,
Please try using the following code example:

Presentation presentation = new Presentation();
try {
    presentation.getSlideSize().setSize(SlideSizeType.Widescreen, SlideSizeScaleType.DoNotScale);

    ISlide slide = presentation.getSlides().get_Item(0);
    IChart chart = slide.getShapes().addChart(ChartType.ClusteredColumn, 28.5f, 101.0f, 902.5f, 355.0f);

    chart.setTitle(false);

    IChartDataWorkbook workbook = chart.getChartData().getChartDataWorkbook();
    workbook.clear(0);
    final int worksheetIndex = 0;

    chart.getChartData().getSeries().clear();
    chart.getChartData().getCategories().clear();

    chart.getChartData().getCategories().add(workbook.getCell(worksheetIndex, 1, 0, "4 w/e 06/20/20"));
    chart.getChartData().getCategories().add(workbook.getCell(worksheetIndex, 9, 0, "4 w/e 07/18/20"));

    IChartSeries seriesA = chart.getChartData().getSeries().add(workbook.getCell(worksheetIndex, 1, 1, "A"),chart.getType());
    IChartSeries seriesB = chart.getChartData().getSeries().add(workbook.getCell(worksheetIndex, 2, 1, "B"),chart.getType());
    IChartSeries seriesF = chart.getChartData().getSeries().add(workbook.getCell(worksheetIndex, 3, 1, "F"),chart.getType());
    IChartSeries seriesFF = chart.getChartData().getSeries().add(workbook.getCell(worksheetIndex, 4, 1, "FF"),chart.getType());
    IChartSeries seriesGG = chart.getChartData().getSeries().add(workbook.getCell(worksheetIndex, 5, 1, "GG"),chart.getType());
    IChartSeries seriesHB = chart.getChartData().getSeries().add(workbook.getCell(worksheetIndex, 6, 1, "HB"),chart.getType());
    IChartSeries seriesHC = chart.getChartData().getSeries().add(workbook.getCell(worksheetIndex, 7, 1, "HC"),chart.getType());
    IChartSeries seriesP = chart.getChartData().getSeries().add(workbook.getCell(worksheetIndex, 8, 1, "P"),chart.getType());

    seriesA.getDataPoints().addDataPointForBarSeries(workbook.getCell(worksheetIndex, 1, 4, 5409334848.0598));
    seriesA.getDataPoints().addDataPointForBarSeries(workbook.getCell(worksheetIndex, 9, 4, 12781066992.5529));
    seriesA.getFormat().getFill().setFillType(FillType.Solid);
    seriesA.getFormat().getFill().getSolidFillColor().setColor(new Color(103, 88, 149));

    seriesB.getDataPoints().addDataPointForBarSeries(workbook.getCell(worksheetIndex, 2, 4, 1330755595.5015));
    seriesB.getDataPoints().addDataPointForBarSeries(workbook.getCell(worksheetIndex, 10, 4, 2547646410.3334));
    seriesB.getFormat().getFill().setFillType(FillType.Solid);
    seriesB.getFormat().getFill().getSolidFillColor().setColor(new Color(70, 151, 226));

    seriesF.getDataPoints().addDataPointForBarSeries(workbook.getCell(worksheetIndex, 3, 4, 1011449202.3583));
    seriesF.getDataPoints().addDataPointForBarSeries(workbook.getCell(worksheetIndex, 11, 4, 653765365.9204));
    seriesF.getFormat().getFill().setFillType(FillType.Solid);
    seriesF.getFormat().getFill().getSolidFillColor().setColor(new Color(203, 75, 122));

    seriesFF.getDataPoints().addDataPointForBarSeries(workbook.getCell(worksheetIndex, 4, 4, 72561852353.0204));
    seriesFF.getDataPoints().addDataPointForBarSeries(workbook.getCell(worksheetIndex, 12, 4, 108557091594.716));
    seriesFF.getFormat().getFill().setFillType(FillType.Solid);
    seriesFF.getFormat().getFill().getSolidFillColor().setColor(new Color(255, 181, 0));

    seriesGG.getDataPoints().addDataPointForBarSeries(workbook.getCell(worksheetIndex, 5, 4, 8006116623.1373));
    seriesGG.getDataPoints().addDataPointForBarSeries(workbook.getCell(worksheetIndex, 13, 4, 9384162751.444));
    seriesGG.getFormat().getFill().setFillType(FillType.Solid);
    seriesGG.getFormat().getFill().getSolidFillColor().setColor(new Color(32, 65, 136));

    seriesHB.getDataPoints().addDataPointForBarSeries(workbook.getCell(worksheetIndex, 6, 4, 9842635539.1768));
    seriesHB.getDataPoints().addDataPointForBarSeries(workbook.getCell(worksheetIndex, 14, 4, 16816768653.9758));
    seriesHB.getFormat().getFill().setFillType(FillType.Solid);
    seriesHB.getFormat().getFill().getSolidFillColor().setColor(new Color(240, 110, 45));

    seriesHC.getDataPoints().addDataPointForBarSeries(workbook.getCell(worksheetIndex, 7, 4, 7695322291.567));
    seriesHC.getDataPoints().addDataPointForBarSeries(workbook.getCell(worksheetIndex, 15, 4, 11000979974.3945));
    seriesHC.getFormat().getFill().setFillType(FillType.Solid);
    seriesHC.getFormat().getFill().getSolidFillColor().setColor(new Color(3, 165, 119));

    seriesP.getDataPoints().addDataPointForBarSeries(workbook.getCell(worksheetIndex, 8, 4, 4327172075.7261));
    seriesP.getDataPoints().addDataPointForBarSeries(workbook.getCell(worksheetIndex, 16, 4, 7145991490.5773));
    seriesP.getFormat().getFill().setFillType(FillType.Solid);
    seriesP.getFormat().getFill().getSolidFillColor().setColor(new Color(50, 101, 210));

    chart.getChartData().getSeriesGroups().get_Item(0).setGapWidth(25);

    chart.getAxes().getVerticalAxis().setNumberFormat("[>999999999]$###,,,\"B\";[>999999] $###,,\"M\"; $###");
    chart.getAxes().getVerticalAxis().setNumberFormatLinkedToSource(false);
    chart.getAxes().getVerticalAxis().getTextFormat().getPortionFormat().setFontHeight(10);
    chart.getAxes().getVerticalAxis().getTextFormat().getPortionFormat().setLatinFont(new FontData("Arial"));
    chart.getAxes().getVerticalAxis().setMajorTickMark(TickMarkType.None);
    chart.getAxes().getVerticalAxis().setTitle(true);
    chart.getAxes().getVerticalAxis().getTitle().addTextFrameForOverriding("$");
    chart.getAxes().getVerticalAxis().getTitle().setOverlay(false);
    chart.getAxes().getVerticalAxis().getTitle().getTextFormat().getPortionFormat().setFontBold(NullableBool.False);
    chart.getAxes().getVerticalAxis().getMajorGridLinesFormat().getLine().getFillFormat().setFillType(FillType.NoFill);
    chart.getAxes().getVerticalAxis().getFormat().getLine().setWidth(2);
    chart.getAxes().getVerticalAxis().getFormat().getLine().getFillFormat().setFillType(FillType.Solid);
    chart.getAxes().getVerticalAxis().getFormat().getLine().getFillFormat().getSolidFillColor().setColor(Color.BLACK);

    IPortionFormat titleFormat = chart.getAxes().getVerticalAxis().getTitle().getTextFrameForOverriding().getParagraphs().
            get_Item(0).getParagraphFormat().getDefaultPortionFormat();
    titleFormat.setFontBold(NullableBool.False);
    titleFormat.setFontHeight(10);
    titleFormat.setLatinFont(new FontData("Arial"));

    chart.getAxes().getHorizontalAxis().getTextFormat().getPortionFormat().setFontHeight(10);
    chart.getAxes().getHorizontalAxis().getTextFormat().getPortionFormat().setLatinFont(new FontData("Arial"));
    chart.getAxes().getHorizontalAxis().setMajorTickMark(TickMarkType.None);
    chart.getAxes().getHorizontalAxis().getFormat().getLine().setWidth(2);
    chart.getAxes().getHorizontalAxis().getFormat().getLine().getFillFormat().setFillType(FillType.Solid);
    chart.getAxes().getHorizontalAxis().getFormat().getLine().getFillFormat().getSolidFillColor().setColor(Color.BLACK);

    chart.getPlotArea().getFormat().getLine().getFillFormat().setFillType(FillType.Solid);
    chart.getPlotArea().getFormat().getLine().setDashStyle(LineDashStyle.Dot);

    chart.getLegend().setPosition(LegendPositionType.Bottom);
    chart.getLegend().getTextFormat().getPortionFormat().setFontHeight(9);
    chart.getLegend().getTextFormat().getPortionFormat().setLatinFont(new FontData("Arial"));

    for (IChartSeries dataSeries : chart.getChartData().getSeries())
    {
        for (IDataLabel dataLabel : dataSeries.getLabels())
        {
            dataLabel.getDataLabelFormat().setNumberFormat("[>999999999]$#.00,,,\"B\";[>999999] $#.00,,\"M\"; $#.00");
            dataLabel.getDataLabelFormat().setNumberFormatLinkedToSource(false);
            dataLabel.getDataLabelFormat().setShowValue(true);

            dataLabel.getDataLabelFormat().getTextFormat().getPortionFormat().setFontHeight(8);
            dataLabel.getDataLabelFormat().getTextFormat().getPortionFormat().setLatinFont(new FontData("Arial"));
        }
    }

    presentation.save("output.pptx", SaveFormat.Pptx);
} finally {
    presentation.dispose();
}