Here’s the fact : I made a tiny app which consist of a table related to a bar chart (a birt one … of course), when I modify my table values it automaticaly alter my chart (like Excel but less fancy) …
Anyway everything works fine … BUT when I want to make my chart interactive in order to show tooltips (for example) I inform naturaly my
IDeviceRenderer
whit the following command
idr.setProperty( IDeviceRenderer.UPDATE_NOTIFIER, this );
but doing so brings an error when (much later) my code come to
gr.render(idr, gr.build(idr.getDisplayServer(), this.chart, bo, vroum,null));
(Which have never failed before) …
I feel lost …
ps:
The error I get are that I get no bars to my chart and receive the following error message :
org.eclipse.birt.chart.exception.ChartException
at org.eclipse.birt.chart.factory.Generator.render(Generator.java:1373)
at clickable.chart.ClickableProto.paintControl(ClickableProto.java:520)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:217)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1012)
at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java:1424)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:3842)
at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:337)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4541)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2371)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3420)
at clickable.chart.ClickableProto.main(ClickableProto.java:151)
Caused by: java.lang.NullPointerException
at org.eclipse.birt.chart.render.InteractiveRenderer.isColoredByCategories(InteractiveRenderer.java:197)
at org.eclipse.birt.chart.render.InteractiveRenderer.getSource(InteractiveRenderer.java:161)
at org.eclipse.birt.chart.render.InteractiveRenderer.modifyEvent(InteractiveRenderer.java:116)
at org.eclipse.birt.chart.device.swt.SwtRendererImpl.fillPolygon(SwtRendererImpl.java:502)
at org.eclipse.birt.chart.event.PolygonRenderEvent.fill(PolygonRenderEvent.java:156)
at org.eclipse.birt.chart.render.DeferredCache.flushPlanes(DeferredCache.java:499)
at org.eclipse.birt.chart.render.DeferredCache.flushOptions(DeferredCache.java:271)
at org.eclipse.birt.chart.render.DeferredCacheManager.flushOptions(DeferredCacheManager.java:165)
at org.eclipse.birt.chart.render.AxesRenderer.flushClipping(AxesRenderer.java:3416)
at org.eclipse.birt.chart.render.AxesRenderer.restoreClipping(AxesRenderer.java:3401)
at org.eclipse.birt.chart.render.Bar.renderSeries(Bar.java:1533)
at org.eclipse.birt.chart.render.AxesRenderer.renderPlot(AxesRenderer.java:2181)
at org.eclipse.birt.chart.render.AxesRenderer.render(AxesRenderer.java:314)
at org.eclipse.birt.chart.factory.Generator.render(Generator.java:1368)
… 14 more
I am open to any idea !
Finally I managed it on my own …
So here are some common mistakes not to make when you make a chart on BIRT and wnat it to be interactive …
1 Implement barely anything which need to be overriden
I personnaly forgot to override
and
comming with the ICallBackNotifier implementation …
2 Do not nest your chart (or be prepared to nest most of your methods too)
I had my chart not directly on my shell but nested in a bunch of composites widgets, canvas and such … Therefore my canvas where hidding my shell which was the only one able to react in the way I wanted to my mouse controller.
(Funny fact : I figured this all out when I (for no reason) tried to drag a small part of my shell which was not overlapped by the chart and drop it on my bars … There the tooltip poped … ^^ Funny way to understand how things work :p)
3 Do not be me …
It is to much work and pain for a barely acceptable result ;p
Hope this help, dont hesitate to mail me if you face the same probleme, I’d be glad to help as much as I can ^^