You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! We are trying to make a dashboard in our software using several meter-charts and bar-charts. However, we get a strange null-pointer exception. Specifically on line final double sideOfSquare = Math.floor((datasetMetaItem.getController().getInnerRadius() * 2) / SQRT_2); in the baseMeterController.execute(), it says the datasetMetaItem is null. With some debugging I find that one specific chart seems to not be initialized in the abstractChart.lookForConsistentInstance which results in the datasetMetaItem being null (note, a comment above this line states it can not be null so this is quite curious!).
The specific chart that gives the error is the last meter-chart. A simplification of our layout would be:
meter X | barchart Z
meter Y | barchart Z
In this case meterChart Y will give the null-pointer, meterChart X works alright. If I remove the barchart Z from the layout altogether, then meterChart Y will also work and there is no null-pointer exception. So it is a confusing situation I think! Below I will add our code, so hopefully you can replicate it.
Small update: we found some workaround. If we set the chart.isVisible(false) during initialization, and then after the container page has been fully loaded, we set chart.isVisible(true) the charts are drawn without error! It doesn't make too much sense to me yet, but it seems to work so far. And perhaps the info is useful for you as well.
uhm.. really strange. I haven't got time to investigate a bit. I'll do asap.
The first think is related to the DOM observer, used to draw the chart. And in fact, setting the chart invisible could be the workaround.
I have never used UIBinder as you describe because I usually set the Chart directly in UIBinder (being the chart a SimplePanel).
Hi! We are trying to make a dashboard in our software using several meter-charts and bar-charts. However, we get a strange null-pointer exception. Specifically on line
final double sideOfSquare = Math.floor((datasetMetaItem.getController().getInnerRadius() * 2) / SQRT_2);
in thebaseMeterController.execute()
, it says thedatasetMetaItem
is null. With some debugging I find that one specific chart seems to not be initialized in theabstractChart.lookForConsistentInstance
which results in thedatasetMetaItem
being null (note, a comment above this line statesit can not be null
so this is quite curious!).The specific chart that gives the error is the last meter-chart. A simplification of our layout would be:
meter X | barchart Z
meter Y | barchart Z
In this case meterChart Y will give the null-pointer, meterChart X works alright. If I remove the barchart Z from the layout altogether, then meterChart Y will also work and there is no null-pointer exception. So it is a confusing situation I think! Below I will add our code, so hopefully you can replicate it.
ui.xml:
Java:
We are using Charba 6.5-gwt and GWT 2.10.1
The text was updated successfully, but these errors were encountered: