for (int i = 0; i < chartAxises.getLength(); i++) {
ChartAxisElement axis = (ChartAxisElement) chartAxises.item(i);
String dimension = axis.getAttributeNS(OdfDocumentNamespace.CHART.getUri(), "dimension");
if (dimension.equals(dimType)) {
NodeList titles = axis.getElementsByTagName(ChartTitleElement.ELEMENT_NAME.getQName());
ChartTitleElement axisTitle;
if (titles.getLength() == 0) {
axisTitle = axis.newChartTitleElement();
if (dimension.equals(ChartDimensionAttribute.Value.x.toString())) {
axisTitle.setSvgXAttribute(AXIS_SVG_X);
axisTitle.setSvgYAttribute(AXIS_SVG_Y);
} else {
axisTitle.setSvgXAttribute("0.161cm");
axisTitle.setSvgYAttribute("4.188cm");
}
axisTitle.setProperty(StyleTextPropertiesElement.FontSize, AXIS_FONTSIZE);
axisTitle.setProperty(StyleTextPropertiesElement.FontSizeAsian, AXIS_FONTSIZEASIAN);
axisTitle.setProperty(StyleTextPropertiesElement.FontSizeComplex, AXIS_FONTSIZECOMPLEX);
} else {
axisTitle = (ChartTitleElement) titles.item(0);
}
NodeList paras = axisTitle.getElementsByTagNameNS(OdfDocumentNamespace.TEXT.getUri(), "p");
if (paras.getLength() == 0) {
axisTitle.newTextPElement().setTextContent(title);
} else {
TextPElement para0 = (TextPElement) paras.item(0);
para0.setTextContent(title);
}