Code Monkey home page Code Monkey logo

Comments (5)

AlexNosk avatar AlexNosk commented on June 6, 2024

@fusheng-fate Could you please attach your source and output documents here for testing? We will check the issue and provide you more information.

PS: the main place for getting support is Aspose.Words support forum. It is better to post the questions there to get faster reply.

from aspose.words-for-java.

fusheng-fate avatar fusheng-fate commented on June 6, 2024
@Test
public void testas() throws Exception {

    Document doc = new Document();
    DocumentBuilder builder = new DocumentBuilder(doc);
    // Insert a chart shape with a document builder and get its chart.
    Shape chartShape = builder.insertChart(ChartType.PIE, 432, 256);
    Chart chart = chartShape.getChart();
    chart.getSeries().clear();
    chart.getSeries().add("Aspose Test Series",
            new String[]{"Word", "PDF", "Excel", "GoogleDocs", "Note"},
            new double[]{500.0, 1.0, 1.0, 2.0, 2.0});

    ChartDataLabelCollection dataLabels = chart.getSeries().get(0).getDataLabels();
    for (int i = 0; i < 5 ; i++) {
        dataLabels.add(i).setShowLeaderLines(true);
        dataLabels.get(i).setShowPercentage(true);
        dataLabels.get(i).setShowValue(true);
        dataLabels.get(i).getNumberFormat().setFormatCode("0.00%");
        dataLabels.get(i).setShowDataLabelsRange(true);
    }
    // Use the "Title" property to give our chart a title, which appears at the top center of the chart area.
    ChartTitle title = chart.getTitle();
    title.setText("My Chart");
    // Set the "Show" property to "true" to make the title visible.
    title.setShow(true);
    // Set the "Overlay" property to "true" Give other chart elements more room by allowing them to overlap the title
    title.setOverlay(false);
    doc.save("d:/" + "Charts.ChartTitle.docx");
}

aspose_pie

from aspose.words-for-java.

fusheng-fate avatar fusheng-fate commented on June 6, 2024

@AlexNosk Thank you for your reply. This is my test code. I have found a corresponding API to handle the issue of setting percentage accuracy, but the issue of overlapping labels cannot be resolved.

from aspose.words-for-java.

AlexNosk avatar AlexNosk commented on June 6, 2024

@fusheng-fate Unfortunately, currently there is no way to specify position of data labels. This feature request is logged as WORDSNET-21965. We will keep you updated and let you know once it is resolved.

from aspose.words-for-java.

fusheng-fate avatar fusheng-fate commented on June 6, 2024

@AlexNosk Thank you.

from aspose.words-for-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.