test_class.declarator: CATEGORIES = Arrays.asList("cat 1", "cat 2", "cat 3", "cat 4", "cat 5")
test_class.modifier: private static final
test_class.original_string: private static final List<?> CATEGORIES = Arrays.asList("cat 1", "cat 2", "cat 3", "cat 4", "cat 5");
test_class.type: List<?>
test_class.var_name: CATEGORIES
test_class.declarator: VALUES =
              Arrays.asList(Arrays.asList(5, 7, 10, 12, 6), Arrays.asList(20, 12, 10, 5, 14))
test_class.modifier: private static final
test_class.original_string: private static final List<List<? extends Number>> VALUES =
              Arrays.asList(Arrays.asList(5, 7, 10, 12, 6), Arrays.asList(20, 12, 10, 5, 14));
test_class.type: List<List<? extends Number>>
test_class.var_name: VALUES
test_class.file: web/src/test/java/org/devgateway/toolkit/web/excelcharts/ExcelChartDefaultTest.java
test_class.identifier: ExcelChartDefaultTest
test_case.body: @Test
      public void createWorkbook() throws Exception {
          final ExcelChart excelChart = new ExcelChartDefault("line chart", ChartType.line, CATEGORIES, VALUES);
          excelChart.configureSeriesTitle(Arrays.asList("foo", "bar"));
          final Workbook workbook = excelChart.createWorkbook();
          Assert.assertNotNull(workbook);
  
          final Sheet sheet = workbook.getSheet(ChartType.line.toString());
          Assert.assertNotNull(sheet);
  
          final XSSFDrawing drawing = (XSSFDrawing) sheet.getDrawingPatriarch();
          final List<XSSFChart> charts = drawing.getCharts();
          Assert.assertEquals("number of charts", 1, charts.size());
  
          final XSSFChart chart = charts.get(0);
          Assert.assertEquals("chart title", "line chart", chart.getTitleText().getString());
  
          final CTChart ctChart = chart.getCTChart();
          Assert.assertEquals("We should not have any area chart", 0, ctChart.getPlotArea().getAreaChartArray().length);
          Assert.assertEquals("Check if we have 1 line chart", 1, ctChart.getPlotArea().getLineChartArray().length);
          Assert.assertEquals("Check that we have a legend and that it's position is bottom", STLegendPos.B,
                  ctChart.getLegend().getLegendPos().getVal());
  
          // check the actual chart data
          final CTLineChart ctLineChart = ctChart.getPlotArea().getLineChartArray()[0];
          final CTLineSer[] ctLineSer = ctLineChart.getSerArray();
          Assert.assertEquals("Check number of CTLineSer", 2, ctLineSer.length);
          Assert.assertEquals("check first series title", "foo", ctLineSer[0].getTx().getV());
          Assert.assertEquals("check second series title", "bar", ctLineSer[1].getTx().getV());
  
          final CTAxDataSource cat1 = ctLineSer[0].getCat();
          Assert.assertEquals("check first category", "cat 1", cat1.getStrRef().getStrCache().getPtArray()[0].getV());
          Assert.assertEquals("check last category", "cat 5", cat1.getStrRef().getStrCache().getPtArray()[4].getV());
          final CTAxDataSource cat2 = ctLineSer[1].getCat();
          Assert.assertEquals("check first category", "cat 1", cat2.getStrRef().getStrCache().getPtArray()[0].getV());
          Assert.assertEquals("check last category", "cat 5", cat2.getStrRef().getStrCache().getPtArray()[4].getV());
  
          final CTNumDataSource val1 = ctLineSer[0].getVal();
          Assert.assertEquals("check first value", "5.0", val1.getNumRef().getNumCache().getPtArray()[0].getV());
          Assert.assertEquals("check last value", "6.0", val1.getNumRef().getNumCache().getPtArray()[4].getV());
          final CTNumDataSource val2 = ctLineSer[1].getVal();
          Assert.assertEquals("check first value", "20.0", val2.getNumRef().getNumCache().getPtArray()[0].getV());
          Assert.assertEquals("check last value", "14.0", val2.getNumRef().getNumCache().getPtArray()[4].getV());
  
          final List<? extends XSSFChartAxis> axis = chart.getAxis();
          Assert.assertEquals("number of axis", 2, axis.size());
          Assert.assertTrue("category axis", axis.get(0) instanceof XSSFCategoryAxis);
          Assert.assertTrue("value axis", axis.get(1) instanceof XSSFValueAxis);
      }
test_case.class_method_signature: ExcelChartDefaultTest.createWorkbook()
test_case.full_signature: @Test public void createWorkbook()
test_case.identifier: createWorkbook
test_case.invocations: configureSeriesTitle asList createWorkbook assertNotNull getSheet toString assertNotNull getDrawingPatriarch getCharts assertEquals size get assertEquals getString getTitleText getCTChart assertEquals getAreaChartArray getPlotArea assertEquals getLineChartArray getPlotArea assertEquals getVal getLegendPos getLegend getLineChartArray getPlotArea getSerArray assertEquals assertEquals getV getTx assertEquals getV getTx getCat assertEquals getV getPtArray getStrCache getStrRef assertEquals getV getPtArray getStrCache getStrRef getCat assertEquals getV getPtArray getStrCache getStrRef assertEquals getV getPtArray getStrCache getStrRef getVal assertEquals getV getPtArray getNumCache getNumRef assertEquals getV getPtArray getNumCache getNumRef getVal assertEquals getV getPtArray getNumCache getNumRef assertEquals getV getPtArray getNumCache getNumRef getAxis assertEquals size assertTrue get assertTrue get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void createWorkbook()
focal_class.declarator: type
focal_class.modifier: private final
focal_class.original_string: private final ChartType type;
focal_class.type: ChartType
focal_class.var_name: type
focal_class.declarator: title
focal_class.modifier: private final
focal_class.original_string: private final String title;
focal_class.type: String
focal_class.var_name: title
focal_class.declarator: categories
focal_class.modifier: private final
focal_class.original_string: private final List<?> categories;
focal_class.type: List<?>
focal_class.var_name: categories
focal_class.declarator: values
focal_class.modifier: private final
focal_class.original_string: private final List<List<? extends Number>> values;
focal_class.type: List<List<? extends Number>>
focal_class.var_name: values
focal_class.declarator: workbook
focal_class.modifier: private final
focal_class.original_string: private final Workbook workbook;
focal_class.type: Workbook
focal_class.var_name: workbook
focal_class.declarator: seriesTitle
focal_class.modifier: private final
focal_class.original_string: private final List<String> seriesTitle;
focal_class.type: List<String>
focal_class.var_name: seriesTitle
focal_class.declarator: COLUMNWIDTH = 3500
focal_class.modifier: private static final
focal_class.original_string: private static final int COLUMNWIDTH = 3500;
focal_class.type: int
focal_class.var_name: COLUMNWIDTH
focal_class.file: web/src/main/java/org/devgateway/toolkit/web/excelcharts/ExcelChartDefault.java
focal_class.identifier: ExcelChartDefault
focal_class.interfaces: implements ExcelChart
focal_class.class_method_signature: ExcelChartDefault.ExcelChartDefault(final String title, final ChartType type, final List<?> categories,
              final List<List<? extends Number>> values)
focal_class.full_signature: public  ExcelChartDefault(final String title, final ChartType type, final List<?> categories,
              final List<List<? extends Number>> values)
focal_class.identifier: ExcelChartDefault
focal_class.modifiers: public
focal_class.parameters: (final String title, final ChartType type, final List<?> categories,
              final List<List<? extends Number>> values)
focal_class.signature:  ExcelChartDefault(final String title, final ChartType type, final List<?> categories,
              final List<List<? extends Number>> values)
focal_class.class_method_signature: ExcelChartDefault.createWorkbook()
focal_class.full_signature: @Override public Workbook createWorkbook()
focal_class.identifier: createWorkbook
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Workbook
focal_class.signature: Workbook createWorkbook()
focal_class.class_method_signature: ExcelChartDefault.configureSeriesTitle(final List<String> seriesTitle)
focal_class.full_signature: @Override public void configureSeriesTitle(final List<String> seriesTitle)
focal_class.identifier: configureSeriesTitle
focal_class.modifiers: @Override public
focal_class.parameters: (final List<String> seriesTitle)
focal_class.return: void
focal_class.signature: void configureSeriesTitle(final List<String> seriesTitle)
focal_class.class_method_signature: ExcelChartDefault.addCategories(final ExcelChartSheet excelChartSheet)
focal_class.full_signature: private void addCategories(final ExcelChartSheet excelChartSheet)
focal_class.identifier: addCategories
focal_class.modifiers: private
focal_class.parameters: (final ExcelChartSheet excelChartSheet)
focal_class.return: void
focal_class.signature: void addCategories(final ExcelChartSheet excelChartSheet)
focal_class.class_method_signature: ExcelChartDefault.addValues(final ExcelChartSheet excelChartSheet)
focal_class.full_signature: private void addValues(final ExcelChartSheet excelChartSheet)
focal_class.identifier: addValues
focal_class.modifiers: private
focal_class.parameters: (final ExcelChartSheet excelChartSheet)
focal_class.return: void
focal_class.signature: void addValues(final ExcelChartSheet excelChartSheet)
focal_method.body: @Override
      public Workbook createWorkbook() {
          final ExcelChartSheet excelChartSheet = new ExcelChartSheetDefault(workbook, type.toString());
          final Chart chart = excelChartSheet.createChartAndLegend();
  
          addCategories(excelChartSheet);
          addValues(excelChartSheet);
  
          final CustomChartDataFactory customChartDataFactory = new CustomChartDataFactoryDefault();
          final CustomChartData chartData = customChartDataFactory.createChartData(type, title);
  
          final ChartDataSource<?> categoryDataSource = excelChartSheet.getCategoryChartDataSource();
          final List<ChartDataSource<Number>> valuesDataSource = excelChartSheet.getValuesChartDataSource();
          for (int i = 0; i < valuesDataSource.size(); i++) {
              final ChartDataSource<Number> valueDataSource = valuesDataSource.get(i);
              if (seriesTitle.isEmpty()) {
                  chartData.addSeries(categoryDataSource, valueDataSource);
              } else {
                  chartData.addSeries(seriesTitle.get(i), categoryDataSource, valueDataSource);
              }
          }
  
          // we don't have any axis for a pie chart
          if (type.equals(ChartType.pie)) {
              chart.plot(chartData);
          } else {
              // Use a category axis for the bottom axis.
              final ChartAxis bottomAxis = chart.getChartAxisFactory().createCategoryAxis(AxisPosition.BOTTOM);
              final ValueAxis leftAxis = chart.getChartAxisFactory().createValueAxis(AxisPosition.LEFT);
              leftAxis.setCrosses(AxisCrosses.AUTO_ZERO);
  
              chart.plot(chartData, bottomAxis, leftAxis);
          }
  
          return workbook;
      }
focal_method.class_method_signature: ExcelChartDefault.createWorkbook()
focal_method.full_signature: @Override public Workbook createWorkbook()
focal_method.identifier: createWorkbook
focal_method.invocations: toString createChartAndLegend addCategories addValues createChartData getCategoryChartDataSource getValuesChartDataSource size get isEmpty addSeries addSeries get equals plot createCategoryAxis getChartAxisFactory createValueAxis getChartAxisFactory setCrosses plot
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: Workbook
focal_method.signature: Workbook createWorkbook()