How can I create a pop up screen when user clicks part of the pie chart?
For instance;
- My pie chart shows the distribution of languages such as English 50% German 20% French 20% and Italian 10% etc.
- A pop up screen which shows information about English distribution must be shown when user clicks English part in pie chart.
How can I do that in vaadin with invient charts add on?
Use the
com.invient.vaadin.charts.InvientCharts.PointClickListenerlike this:Very simple 🙂 getWindow() method is defined in Component, so the calling class should be one that implements it. You can get a reference to the main window anywhere in the code, if you are using the ThreadLocal pattern.
EDIT: I forgot to mention that pointItems is declared in the class as follows:
And when creating the points, I put the Point and Item objects to the map. You could also create your own implementation of Point and capsulate the Item inside it. Too bad Invient Charts declares almost every class final so you can’t extend eg. DateTimePoint :/