Worksheet sheet = _spreadsheet.getSelectedSheet();
if (sheet != null && isValidSelection(selection)) {
if (!sheet.getProtect()) {
int row = selection.getTop();
int col = selection.getLeft();
ChartData data = fillCategoryData(new XSSFPieChartData(), selection);
Ranges.range(sheet)
.addChart(getClientAnchor(row, col, 600, 300), data, ChartType.Pie, ChartGrouping.STANDARD, LegendPosition.RIGHT);
} else {
showProtectMessage();