Chart chart = new Chart(chartEle, sName);
chart.setChartTitle(title);
chart.setChartType(ChartType.BAR);
chart.setUseLegend(true);
chart.setChartData(dataset);
DrawFrameElement drawFrame = getChartFrame();
drawFrame.setProperty(StyleGraphicPropertiesElement.OleDrawAspect, "1");
drawFrame.setPresentationUserTransformedAttribute(true);
drawFrame.removeAttributeNS(OdfDocumentNamespace.PRESENTATION.getUri(), "placeholder");
if (rect != null) {
drawFrame.setSvgXAttribute(new Integer(rect.x).toString());
drawFrame.setSvgYAttribute(new Integer(rect.y).toString());
drawFrame.setSvgWidthAttribute(new Integer(rect.width).toString());
drawFrame.setSvgHeightAttribute(new Integer(rect.height).toString());
}
DrawObjectElement drawObject = OdfElement.findFirstChildNode(DrawObjectElement.class, drawFrame);
if(drawObject == null){
drawObject = drawFrame.newDrawObjectElement();
}
if (dataset.getCellRangeAddress() != null){
drawObject.setDrawNotifyOnUpdateOfRangesAttribute(dataset.getCellRangeAddress().toString());
}
drawObject.setXlinkHrefAttribute(ROOT_STRING + sName);