chartPanel.setPreferredSize(new Dimension(0, chartHeight));
chartPanel.addChartMouseListener(new ChartMouseListener() {
@Override
public void chartMouseMoved(ChartMouseEvent event) {
ChartEntity entity = event.getEntity();
if (entity instanceof PieSectionEntity) {
PieSectionEntity pieSectionEntity = (PieSectionEntity) entity;
String sectionKey = (String) pieSectionEntity.getSectionKey();
if (_groups.containsKey(sectionKey)) {
chartPanel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
} else {
chartPanel.setCursor(Cursor.getDefaultCursor());
}
} else {
chartPanel.setCursor(Cursor.getDefaultCursor());
}
}
@Override
public void chartMouseClicked(ChartMouseEvent event) {
ChartEntity entity = event.getEntity();
if (entity instanceof PieSectionEntity) {
PieSectionEntity pieSectionEntity = (PieSectionEntity) entity;
String sectionKey = (String) pieSectionEntity.getSectionKey();
if (_groups.containsKey(sectionKey)) {
drillToGroup(sectionKey, true);