Hi,
Well, you may still use setValueShown(), it will work.
For setShowValue() method, I have tested it with the following sample code and it works fine.
Sample code:
// Obtaining the reference of the first worksheet
WorksheetCollection worksheets = workbook.getWorksheets();
Worksheet sheet = worksheets.get(0);
ChartCollection charts = sheet.getCharts();
int chartIndex = charts.add(ChartType.COLUMN, 5, 0, 15, 5);
Chart chart = charts.get(chartIndex);
Cells cells = sheet.getCells();
cells.get(“A2”).putValue(“Category”);
cells.get(“B1”).putValue(“Value1”);
cells.get(“B2”).setFormula(“=NA()”);
cells.get(“C1”).putValue(“Value2”);
cells.get(“C2”).putValue(2d);
SeriesCollection nSeries = chart.getNSeries();
nSeries.add(“B2:C2”, true);
// set labels for every series
nSeries.setCategoryData(“A2”);
nSeries.get(0).setName(“=B1”);
nSeries.get(1).setName(“=C1”);
// show values
nSeries.get(0).getDataLabels().setShowValue(false);
nSeries.get(1).getDataLabels().setShowValue(true);
// save excel
workbook.save(“outmytesting.xls”);
System.out.println(“finished”);
I am using v7.0.2.4, please try it:
thank you.