Hi, I have created a pie chart. but i need to hook up some click event code for the pie chart. so when user click specific part, i would like to pop up some text message or change the tool tip of the chart.
code:
ChartConfiguration pieConfiguration = new ChartConfiguration();
pieConfiguration.setTitle("TestPie");
pieConfiguration.setChartType(ChartType.PIE);
pieConfiguration.setBackgroundColor(Colors.WHITE);
PieChartSeries pieFruits = new PieChartSeries("Fruits");
PieChartData bananas = new PieChartData("Bananas", 33.2);
PieChartData melons = new PieChartData("Melons", 6.21);
PieChartData apples = new PieChartData("Apples", 3.44);
pieFruits.getData().add(bananas);
pieFruits.getData().add(melons);
pieFruits.getData().add(apples);
pieConfiguration.getSeriesList().add(pieFruits);
try {
HighChart pieChart = HighChartFactory.renderChart(pieConfiguration);
pieChart.setHeight(80, Unit.PERCENTAGE);
pieChart.setWidth(80, Unit.PERCENTAGE);
layout.addComponent(pieChart);
}catch (NoChartTypeException e) {
e.printStackTrace();
}