How do I get a click listener to work with JFreeChart wrapper?

I’m using JFreeChart wrapper, I got it working quite quickly and it displays my chart as expected.

However, now I want to perform an action when a user clicks on the chart. I’ve added a ClickListener to the JFreeChartWrapper, however it never executes when I click on the chart. I’ve also tried adding a ClickListener to the parent layout. When I click on other elements in the layout (for example a Label) the ClickListener executes, however it doesn’t executes when I click on the chart.

Admittedly, the layout ClickListener not executing when clicking on the chart is expected because the JFreeChartWrapper (Interface Embedded) should mask/block the click. However, I would expect the ClickListener on the JFreeChartWrapper to work.

Is anyone else having this problem? Has anyone got the ClickListener working with the JFreeChart?

Does anyone know of an alternative to listen to these clicks?

I got something working. Here’s what I did:

  • Copied all the JFreeChartWrapper source into my own class that extends Button
  • Initialized setIcon to (Application)getSource() in attach()
  • Removed setType() and setMimeType() calls
  • Added some other customizations to my constructor
    • setSvgAspectRatio(), chart.setTextAntiAlias(), setStyleName(), setImmediate(), setSizeFull()