C3Displayer extends C3AbstractDisplayer<V> { protected String[][] getDataTable() { List<DataColumn> columns = dataSet.getColumns(); String data[][] = new String[columns.size()][]; for (int i = 0; i < columns.size(); i++) { List<?> values = columns.get(i).getValues(); data[i] = new String[values.size()]; for (int j = 0; j < values.size(); j++) { data[i][j] = columnValueToString(values.get(j)); } } return data; } C3Displayer(FilterLabelSet filterLabelSet, C3JsTypesFactory builder); @Override DisplayerConstraints createDisplayerConstraints(); static final String[] COLOR_PATTERN; }
@Test public void tableDataTest() { String[][] expectedDataTable = { { "2012", "2013", "2014", "2015" }, { "6126.13", "5252.96", "4015.48", "7336.69"} }; displayer.draw(); C3LineChartDisplayer.View view = displayer.getView(); String[][] dataTable = displayer.getDataTable(); assertArrayEquals(expectedDataTable, dataTable); }