Package com.aspose.slides

Examples of com.aspose.slides.IChartDataWorkbook


    //Setting the index of chart data sheet
    int defaultWorksheetIndex = 0;

    //Getting the chart data worksheet
    IChartDataWorkbook fact = chart.getChartData().getChartDataWorkbook();

    //Changing chart Category Name
    fact.getCell(defaultWorksheetIndex, 1, 0, "Modified Category 1");
    fact.getCell(defaultWorksheetIndex, 2, 0, "Modified Category 2");


    //Take first chart series
    IChartSeries series = chart.getChartData().getSeries().get_Item(0);

    //Now updating series data
    fact.getCell(defaultWorksheetIndex, 0, 1, "New_Series1");//modifying series name
    series.getDataPoints().get_Item(0).getValue().setData (90);
    series.getDataPoints().get_Item(1).getValue().setData ( 123);
    series.getDataPoints().get_Item(2).getValue().setData ( 44);

    //Take Second chart series
    series = chart.getChartData().getSeries().get_Item(1);

    //Now updating series data
    fact.getCell(defaultWorksheetIndex, 0, 2, "New_Series2");//modifying series name
    series.getDataPoints().get_Item(0).getValue().setData (23);
    series.getDataPoints().get_Item(1).getValue().setData ( 67);
    series.getDataPoints().get_Item(2).getValue().setData ( 99);


    //Now, Adding a new series
    chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 0, 3, "Series 3"), chart.getType());

    //Take 3rd chart series
    series = chart.getChartData().getSeries().get_Item(2);

    //Now populating series data
    series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 1, 3, 20));
    series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 2, 3, 50));
    series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 3, 3, 30));

    chart.setType(ChartType.ClusteredCylinder);

    // Save presentation with chart
    pres.save("data/pptx4j/ChartModified-Aspose.pptx", SaveFormat.Pptx)
View Full Code Here


    //Setting the index of chart data sheet
    int defaultWorksheetIndex = 0;

    //Getting the chart data worksheet
    IChartDataWorkbook fact = chart.getChartData().getChartDataWorkbook();

    //Delete default generated series and categories
    chart.getChartData().getSeries().clear();
    chart.getChartData().getCategories().clear();
    int s = chart.getChartData().getSeries().size();
    s = chart.getChartData().getCategories().size();

    //Adding new series
    chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 0, 1, "Series 1"), chart.getType());
    chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 0, 2, "Series 2"), chart.getType());

    //Adding new categories
    chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 1, 0, "Caetegoty 1"));
    chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 2, 0, "Caetegoty 2"));
    chart.getChartData().getCategories().add(fact.getCell(defaultWorksheetIndex, 3, 0, "Caetegoty 3"));

    //Take first chart series
    IChartSeries series = chart.getChartData().getSeries().get_Item(0);

    //Now populating series data

    series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 1, 1, 20));
    series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 2, 1, 50));
    series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 3, 1, 30));

    //Setting fill color for series
    series.getFormat().getFill().setFillType(FillType.Solid);
    series.getFormat().getFill().getSolidFillColor().setColor (Color.RED);


    //Take second chart series
    series = chart.getChartData().getSeries().get_Item(1);

    //Now populating series data
    series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 1, 2, 30));
    series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 2, 2, 10));
    series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 3, 2, 60));

    //Setting fill color for series
    series.getFormat().getFill().setFillType (FillType.Solid);
    series.getFormat().getFill().getSolidFillColor().setColor(Color.GREEN);
View Full Code Here

    //Setting the index of chart data sheet
    int defaultWorksheetIndex = 0;

    //Getting the chart data worksheet
    IChartDataWorkbook fact = chart.getChartData().getChartDataWorkbook();

    //Delete default generated series and categories

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

    //Adding new categories
    chart.getChartData().getCategories().add(fact.getCell(0, 1, 0, "First Qtr"));
    chart.getChartData().getCategories().add(fact.getCell(0, 2, 0, "2nd Qtr"));
    chart.getChartData().getCategories().add(fact.getCell(0, 3, 0, "3rd Qtr"));

    //Adding new series
    IChartSeries series = chart.getChartData().getSeries().add(fact.getCell(0, 0, 1, "Series 1"), chart.getType());

    //Now populating series data
    series.getDataPoints().addDataPointForPieSeries(fact.getCell(defaultWorksheetIndex, 1, 1, 20));
    series.getDataPoints().addDataPointForPieSeries(fact.getCell(defaultWorksheetIndex, 2, 1, 50));
    series.getDataPoints().addDataPointForPieSeries(fact.getCell(defaultWorksheetIndex, 3, 1, 30));


    //Not working in new version
    //Adding new points and setting sector color
    //series.IsColorVaried = true;
View Full Code Here

    //Setting the index of chart data sheet
    int defaultWorksheetIndex = 0;

    //Getting the chart data worksheet
    IChartDataWorkbook fact = chart.getChartData().getChartDataWorkbook();

    //Changing chart Category Name
    fact.getCell(defaultWorksheetIndex, 1, 0, "Modified Category 1");
    fact.getCell(defaultWorksheetIndex, 2, 0, "Modified Category 2");


    //Take first chart series
    IChartSeries series = chart.getChartData().getSeries().get_Item(0);

    //Now updating series data
    fact.getCell(defaultWorksheetIndex, 0, 1, "New_Series1");//modifying series name
    series.getDataPoints().get_Item(0).getValue().setData (90);
    series.getDataPoints().get_Item(1).getValue().setData ( 123);
    series.getDataPoints().get_Item(2).getValue().setData ( 44);

    //Take Second chart series
    series = chart.getChartData().getSeries().get_Item(1);

    //Now updating series data
    fact.getCell(defaultWorksheetIndex, 0, 2, "New_Series2");//modifying series name
    series.getDataPoints().get_Item(0).getValue().setData (23);
    series.getDataPoints().get_Item(1).getValue().setData ( 67);
    series.getDataPoints().get_Item(2).getValue().setData ( 99);


    //Now, Adding a new series
    chart.getChartData().getSeries().add(fact.getCell(defaultWorksheetIndex, 0, 3, "Series 3"), chart.getType());

    //Take 3rd chart series
    series = chart.getChartData().getSeries().get_Item(2);

    //Now populating series data
    series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 1, 3, 20));
    series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 2, 3, 50));
    series.getDataPoints().addDataPointForBarSeries(fact.getCell(defaultWorksheetIndex, 3, 3, 30));

    chart.setType(ChartType.ClusteredCylinder);

    // Save presentation with chart
    pres.save("data/AsposeChartModified.pptx", SaveFormat.Pptx)
View Full Code Here

TOP

Related Classes of com.aspose.slides.IChartDataWorkbook

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.