Hi,
I am able to set the alignment to center, and set the value of my data labels but my attempts to change the font size, color, font etc. do not take affect. Please could you advise my error?
IChartDataWorkbook workBook = chart.getChartData().getChartDataWorkbook(); chart.getChartData().getSeries().clear(); chart.getChartData().getCategories().clear(); chart.setLegend(false); chart.getAxes().getVerticalAxis().setVisible(false); chart.getAxes().getHorizontalAxis().setVisible(false); chart.getAxes().getHorizontalAxis().getMajorGridLinesFormat().getLine().getFillFormat().setFillType(FillType.NoFill); chart.getAxes().getVerticalAxis().getMajorGridLinesFormat().getLine().getFillFormat().setFillType(FillType.NoFill); chart.getAxes().getHorizontalAxis().getMinorGridLinesFormat().getLine().getFillFormat().setFillType(FillType.NoFill); chart.getAxes().getVerticalAxis().getMinorGridLinesFormat().getLine().getFillFormat().setFillType(FillType.NoFill); chart.getChartData().getCategories().add(workBook.getCell(0, 1, 0, "320")); chart.getChartData().getCategories().add(workBook.getCell(0, 2, 0, "240")); IChartSeries series = chart.getChartData().getSeries().add(workBook.getCell(0, 0, 1, "MY SERIES"),chart.getType()); chart.getChartData().getSeries().get_Item(0).getParentSeriesGroup().setOverlap((byte) 0); chart.getChartData().getSeries().get_Item(0).getParentSeriesGroup().setGapWidth(20); IChartDataPoint dP = series.getDataPoints().addDataPointForBarSeries(workBook.getCell(0, 1, 1, 340)); dP.getLabel().getTextFrameForOverriding().setText("NUMBER IS 340"); dP.getLabel().getDataLabelFormat().setPosition(LegendDataLabelPosition.Center); dP.getLabel().getDataLabelFormat().getTextFormat().getPortionFormat().setFontBold(NullableBool.True); dP.getLabel().getDataLabelFormat().getTextFormat().getPortionFormat().setLatinFont (new FontData("DINPro-Bold")); dP.getLabel().getDataLabelFormat().getTextFormat().getPortionFormat().setFontHeight(14); dP.getLabel().getDataLabelFormat().getTextFormat().getPortionFormat().getFillFormat().setFillType (FillType.Solid ); dP.getLabel().getDataLabelFormat().getTextFormat().getPortionFormat().getFillFormat().getSolidFillColor().setColor (Color.WHITE);
Thanks,
Andy