how to add a button on the chart with Javafx?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
smoke
Posts: 1
Joined: Mon Oct 17, 2016 9:38 pm
antibot: No, of course not.
Contact:

how to add a button on the chart with Javafx?

Post by smoke » Mon Oct 17, 2016 9:40 pm

I have seen some posts from a long time back about adding one or more buttons with ActionListeners attached but am not sure if this can be done (easily) with JavaFx version of JFreeChart.

My goal is to be able to provide the user with a way to change colours of XY series on the chart. I may have more than one chart open simultaneously but of course each chart would have its own buttons.

I am examining the ui part of JFreeChart but I guess the JavaFx adds some level I am not yet fully comfortable playing around.
My question is this: are there some examples of how to add a button when the JFreeChart is encapsulated in a JaxaFx window?

E cigarette Wholesale - Joyetech Grossiste- Kangertech Grossiste - Joyetech Wholesale- Kangertech Wholesale - Eleaf Grossiste - Eleaf Wholesale
Last edited by smoke on Sat Apr 21, 2018 3:59 pm, edited 6 times in total.

John Matthews
Posts: 513
Joined: Wed Sep 12, 2007 3:18 pm

Re: how to add a button on the chart with Javafx?

Post by John Matthews » Wed Oct 19, 2016 12:10 am

The example examined here uses a ChartMouseListener to detect mouse clicks. A custom implementation of getItemPaint() alters the color to highlight the selected chart entity.

Locked