1

I have a PieChart with Text displaying their values. My pie chart has a mouse event listener such that when i mouse over the chart, it creates a glow effect.

The problem here is that when my mouse goes over the Text, it blocked my mouse listener as my mouse is effectively over the Text instead of the PieChart. Is there any way i can display the Text but make it such that it's "invisible" to my mouse?

Pseudocode:

PieChart chart = new PieChart();
chart.setData(MY CHART DATA);
chart.getData().forEach(d -> {
  Text text = new Text();
  text.setText((int)d.getPieValue()+"");
  MOVE TEXT TO THE RESPECTIVE PIE AREA
}
Cherple
  • 725
  • 3
  • 10
  • 24
  • 3
    `text.setMouseTransparent(true);`???? – fabian Nov 22 '19 at 06:58
  • 1
    Related info: [https://stackoverflow.com/questions/24607969/mouse-events-get-ignored-on-the-underlying-layer](https://stackoverflow.com/questions/24607969/mouse-events-get-ignored-on-the-underlying-layer). That related question is more complex than what you need though, for you, a simple `setMouseTransparent(true)` call should be enough. – jewelsea Nov 22 '19 at 21:03

1 Answers1

0

Thanks @fabian

"text.setMouseTransparent(true);" did the trick!

Cherple
  • 725
  • 3
  • 10
  • 24