[]
Use this interface to access and customize the label shown for an axis display unit, including its text, font, text frame, and chart formatting. An instance is typically obtained from IAxis.getDisplayUnitLabel() for a value axis.
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Month", "Sales"},
{"Jan", 1200},
{"Feb", 1800}
});
IShape shape = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 220);
shape.getChart().getSeriesCollection().add(worksheet.getRange("A1:B3"), RowCol.Columns, true, true);
IAxis valueAxis = shape.getChart().getAxes().item(AxisType.Value);
valueAxis.setDisplayUnit(DisplayUnit.Hundreds);
IDisplayUnitLabel displayUnitLabel = valueAxis.getDisplayUnitLabel();
displayUnitLabel.setText("Hundreds");
voiddelete()getFont()IFontFormat object that represents the font settings of this display unit label.IChartFormat object for this display unit label.getText()ITextFrame object for the display unit label.voidThe returned IAxis object represents the axis that owns this display unit label.
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Month", "Sales"},
{"Jan", 1200},
{"Feb", 2400}
});
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, worksheet.getRange("A1:B3")).getChart();
IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
axis.setDisplayUnit(DisplayUnit.Thousands);
IDisplayUnitLabel displayUnitLabel = axis.getDisplayUnitLabel();
IAxis parentAxis = displayUnitLabel.getParent();
IAxis object that contains this display unit label.IFontFormat object that represents the font settings of this display unit label.Use the returned IFontFormat object to read or modify the font applied to the display unit label text.
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Month", "Sales"},
{"Jan", 1200},
{"Feb", 2400}
});
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, worksheet.getRange("A1:B3")).getChart();
IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
axis.setDisplayUnit(DisplayUnit.Thousands);
IFontFormat font = axis.getDisplayUnitLabel().getFont();
font.setBold(true);
IFontFormat object for the display unit label font.IChartFormat object for this display unit label.Use the returned format object to access and modify the appearance of the display unit label, such as its fill and line formatting.
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Month", "Sales"},
{"Jan", 1200},
{"Feb", 2400}
});
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, worksheet.getRange("A1:B3")).getChart();
IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
axis.setDisplayUnit(DisplayUnit.Thousands);
IDisplayUnitLabel displayUnitLabel = axis.getDisplayUnitLabel();
IChartFormat format = displayUnitLabel.getFormat();
format.getFill().getColor().setRGB(Color.GetBlue());
IChartFormat object for this display unit label.Use this method to retrieve the current caption shown for the display unit label on an axis.
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Month", "Sales"},
{"Jan", 1200},
{"Feb", 2400}
});
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, worksheet.getRange("A1:B3")).getChart();
IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
axis.setDisplayUnit(DisplayUnit.Thousands);
IDisplayUnitLabel displayUnitLabel = axis.getDisplayUnitLabel();
displayUnitLabel.setText("Thousands");
String text = displayUnitLabel.getText();
Use this method to set or replace the caption shown for the display unit label on an axis.
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Month", "Sales"},
{"Jan", 1200},
{"Feb", 2400}
});
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, worksheet.getRange("A1:B3")).getChart();
IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
axis.setDisplayUnit(DisplayUnit.Thousands);
IDisplayUnitLabel displayUnitLabel = axis.getDisplayUnitLabel();
displayUnitLabel.setText("Thousands");
value - The current text of this display unit label.ITextFrame object for the display unit label.Use the returned ITextFrame object to access and modify the text content and font-related formatting of the display unit label.
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Month", "Sales"},
{"Jan", 1200},
{"Feb", 2400}
});
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, worksheet.getRange("A1:B3")).getChart();
IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
axis.setDisplayUnit(DisplayUnit.Thousands);
IDisplayUnitLabel displayUnitLabel = axis.getDisplayUnitLabel();
ITextFrame textFrame = displayUnitLabel.getTextFrame();
textFrame.getTextRange().setText("Thousands");
ITextFrame object that contains the text and font style properties for the display unit label.After this method is called, the display unit label is no longer shown on the axis.
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Month", "Sales"},
{"Jan", 1200},
{"Feb", 2400}
});
IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, worksheet.getRange("A1:B3")).getChart();
IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
axis.setDisplayUnit(DisplayUnit.Thousands);
IDisplayUnitLabel displayUnitLabel = axis.getDisplayUnitLabel();
displayUnitLabel.delete();