Hello,
I can’t display chart data table. Here is my code :
//Instantiating a Workbook object
Workbook workbook = new Workbook();
//Obtaining the reference of the first worksheet
Worksheet worksheet = workbook.getWorksheets().get(0);
//Adding a sample value to "A1" cell
worksheet.getCells().get("A1").putValue(50);
worksheet.getCells().get("A2").putValue(100);
worksheet.getCells().get("A3").putValue(150);
//Adding a sample value to "B1" cell
worksheet.getCells().get("B1").putValue(60);
worksheet.getCells().get("B2").putValue(32);
worksheet.getCells().get("B3").putValue(50);
//Adding a chart to the worksheet
int chartIndex = worksheet.getCharts().add(ChartType.COLUMN, 5, 0, 25, 10);
//Accessing the instance of the newly added chart
Chart chart = worksheet.getCharts().get(chartIndex);
//Adding NSeries (chart data source) to the chart ranging from "A1" cell to "B3"
chart.getNSeries().add("A1:B3", true);
chart.setShowDataTable(true);
//Getting Chart Table
ChartDataTable chartTable = chart.getChartDataTable();
//Setting Chart Table Font Color
chartTable.getFont().setColor(com.aspose.cells.Color.getRed());
chartTable.setBackgroundMode(BackgroundMode.OPAQUE);
//Setting Legend Key Visibility
chartTable.setShowLegendKey(true);
chartTable.setHasBorderHorizontal(true);
chartTable.setHasBorderOutline(true);
chartTable.setHasBorderVertical(true);
// Save the Microsoft Excel file.
workbook.save(dataDir + "MyBook.xls");
I tried other charts and settings - no way
Please, need help!
Thanks in advance and have a nice day