Refresh Chart on box and whiskers

Dear all,

I am trying to refresh a box and whisker chart, the chart is using a cell updating linked to a running timer. However, the chart is not updating even though the value is changing unless i add a new row to the dataset of the chart. I am hoping that i can do a refresh on the chart to update it.

I try to script using a button to refresh the chart but i am unable to do it. Could anyone help to suggestion what can i do ?

This is put unable the button event handler mouseclicked.

chart = event.source.parent.getComponent('Box and Whisker Chart').data
chart.refreshChart(0,0)

I couldn't get that to work either when I offered this work around for your original post.

The fact that the chart's propertyChange event handler never detects the 'data' property change leads me to believe that there is something missing or broken in this component.

The chart does detect data changes, but passes it on to the JFreeChart implementation.

But it sound like you are mutating a dataset in place instead of supplying a modified dataset. How are you doing your update?

When I experimented with this, I tried multiple different ways. The first way was to put the cell update binding directly on the chart's dataset. When that didn't work, I moved the data to custom property and used the cell update binding on the custom property dataset. Then, using a propertyChange script, I replaced the chart's dataset with the custom property dataset any time the custom property changed.

The problem is that unless the row count of the new dataset is different from the chart's initial dataset, the chart won't update. I got around this by writing a blank dataset to the chart's data property and in the next line writing the changed dataset to the chart's data property. This forced the chart to update any time the cell update binding changed a value in the custom property's data.

It's worth mentioning that I also tried simply binding the chart's data to the custom property, but the result was the same. There was no visible update unless the row count changed.

Try using this JFreeChart.fireChartChanged() in your propertyChange event.

Yes. I tried that as well. I was surprised it didn't work either