How to get the exact item click on a histogram chart

I have a chart
image

I suscribe to the chart event GraphItemClickEvent
https://docs.jmix.io/1.x/jmix/1.6/charts/events.html#graph-item-click-event

The event contains dataItem of the selected bar,
but I found no way to know exact item (which color) has been clicked.

How can I have the exact item clicked ?

Click on the first bar
image

Click on the bottom of the second bar
image

Click on the middle of the second bar
image

Click on the top of the second bar
image

Hello!

The GraphItemClickEvent contains ID of clicked graph, so you can try to detect what color is clicked by this ID.

You can specify an ID for every graph in XML to make more convenient handling:

<chart:graphs>
    <chart:graph id="graphCars"
                 .../>
    <chart:graph id="graphMotorcycles"
                 .../>
    <chart:graph id="graphBicycles"
                 .../>
</chart:graphs>