Hi,
I'm using CN1 Charts to plot a pie chart, as given in the Charts Demo. When I tap a segment I'd like the chart to zoom into the segment and then display a
Dialog providing details of the segment.
I've managed to get it working, however, the
Dialog is shown before the segment is zoomed in. How can I get the zoom operation to first complete before showing the
Dialog?
callSeriallyAndWait throws a runtime exception.
Many thanks
@Override
protected void seriesReleased(final SeriesSelection sel) {
for (SimpleSeriesRenderer r : renderer.getSeriesRenderers()){
r.setHighlighted(false);
}
SimpleSeriesRenderer r = renderer.getSeriesRendererAt(sel.getPointIndex());
r.setHighlighted(true);
Shape seg = chart.getSegmentShape(sel.getPointIndex());
Rectangle bounds = seg.getBounds();
bounds = new Rectangle(
bounds.getX()-40,
bounds.getY()-40,
bounds.getWidth()+80,
bounds.getHeight()+80);
zoomToShapeInChartCoords(bounds, 500);
// I'd like this to show AFTER the zoom has completed
Dialog.show("Info", "Segment info goes here.", "OK", null);
}