java.util.List<PieSectorProperties> sectors = chartView.getSectors();
if (sectors == null || sectors.size() == 0)
return;
for (PieSectorProperties sector : sectors) {
DynamicPieGenerator generator = new DynamicPieGenerator(chartView, null);
int index = -1;
Float sectorPulled = sector.getPulled();
if (dataset instanceof CategoryToPieDataset) {
CategoryToPieDataset cds = (CategoryToPieDataset) dataset;
int count = getIterationCount(cds);
for (int q = 0; q < count; q++) {
CategoryToPieDataset currPieDataset = new CategoryToPieDataset(categoryDataset, order, q);
java.util.List keys = currPieDataset.getKeys();
index = -1;
for (int j = 0; j < keys.size(); j++) {
index++;
boolean conditionValue = generator.getConditionValue(sector, q, currPieDataset, currPieDataset.getKey(j));
if (!conditionValue)
continue;
if (sectorPulled != null && sectorPulled > 0) {
plot.setExplodePercent(index, (double) sectorPulled);
}
StyleObjectModel cssSectorModel = sector.getStyleObjectModel();
if (cssSectorModel != null && cssSectorModel.getBorder() != null) {
StyleBorderModel border = cssSectorModel.getBorder();
Color borderColor = border.getColor();
if (borderColor != null) {
plot.setSectionOutlinePaint(index, borderColor);
plot.setSectionOutlineStroke(index, PropertiesConverter.toStroke(border));
}
Color sectorModelColor = cssSectorModel.getColor();
if (sectorModelColor != null) {
plot.setSectionPaint(index, sectorModelColor);
}
}
}
}
} else {
if (dataset == null || dataset.getKeys() == null)
continue;
for (int j = 0; j < dataset.getKeys().size(); j++) {
index++;
boolean conditionValue = generator.getConditionValue(sector, 0, dataset, dataset.getKey(j));
if (!conditionValue)
continue;
if (sectorPulled != null && sectorPulled > 0) {
plot.setExplodePercent(index, (double) sectorPulled);