Search in sources :

Example 6 with ChartDataSource

use of org.apache.poi.ss.usermodel.charts.ChartDataSource in project oc-explorer by devgateway.

the class ExcelChartSheetDefaultTest method getCategoryChartDataSource.

@Test
public void getCategoryChartDataSource() throws Exception {
    final ExcelChartSheet excelChartSheet = new ExcelChartSheetDefault(workbook, ChartType.barcol.toString());
    addCategories(excelChartSheet);
    ChartDataSource categoryChartDataSource = excelChartSheet.getCategoryChartDataSource();
    Assert.assertEquals("check count of categories", 5, categoryChartDataSource.getPointCount());
    Assert.assertEquals("check first category", "cat 1", categoryChartDataSource.getPointAt(0));
    Assert.assertEquals("check last category", "cat 5", categoryChartDataSource.getPointAt(4));
}
Also used : ChartDataSource(org.apache.poi.ss.usermodel.charts.ChartDataSource) Test(org.junit.Test)

Aggregations

ChartDataSource (org.apache.poi.ss.usermodel.charts.ChartDataSource)6 Chart (org.apache.poi.ss.usermodel.Chart)2 ChartAxis (org.apache.poi.ss.usermodel.charts.ChartAxis)2 ValueAxis (org.apache.poi.ss.usermodel.charts.ValueAxis)2 CellRangeAddress (org.apache.poi.ss.util.CellRangeAddress)2 CustomChartDataFactory (org.devgateway.toolkit.web.excelcharts.util.CustomChartDataFactory)2 CustomChartDataFactoryDefault (org.devgateway.toolkit.web.excelcharts.util.CustomChartDataFactoryDefault)2 Test (org.junit.Test)2