@Override
public Chart addChart(ClientAnchor anchor, ChartData data, ChartType type,
ChartGrouping grouping, LegendPosition pos) {
synchronized (_sheet) {
final DrawingManager dm = ((SheetCtrl)_sheet).getDrawingManager();
final XSSFChartX chartX = (XSSFChartX) dm.addChartX(_sheet, anchor, data, type, grouping, pos);
final RangeImpl rng = (RangeImpl) Ranges.range(_sheet, anchor.getRow1(), anchor.getCol1(), anchor.getRow2(), anchor.getCol2());
final Collection<Ref> refs = rng.getRefs();
if (refs != null && !refs.isEmpty()) {
final Ref ref = refs.iterator().next();
BookHelper.notifyChartAdd(ref, chartX);
}
return chartX.getChart();
}
}