Adding a overlay to a chart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
sidney van de stouwe
Posts: 3
Joined: Sat Dec 18, 2010 9:55 am
antibot: No, of course not.

Adding a overlay to a chart

Post by sidney van de stouwe » Sat Nov 21, 2015 10:20 pm

I would like to know how to add an overlay (Crosshair) using the chartviewer to show the chart in an FX StackPane.
I know how to do it using the chart panel but the chartviewer only accept a chart.

As a work around I'm using the swing chartnode and that work nicely. As you can see in the code below

Code: Select all

            // add the chart and the crosshair overlay to the swing node
            chartpanel = new ChartPanel(chart);
            chartpanel.addOverlay(overlay);
            chartNode.setContent(chartpanel);
            // display the chart on the stackpane
            pane.getChildren().addAll(chartNode);
But a prefer using the new chartviewer so:
Please anybody got any suggestion how to do just that?

Thanks

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: Adding a overlay to a chart

Post by david.gilbert » Tue Nov 24, 2015 5:40 pm

Overlay support hasn't been added to the ChartViewer yet. It's an important feature to support though, so hopefully I can get a chance to add it soon.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

sidney van de stouwe
Posts: 3
Joined: Sat Dec 18, 2010 9:55 am
antibot: No, of course not.

Re: Adding a overlay to a chart

Post by sidney van de stouwe » Tue Nov 24, 2015 6:33 pm

Hi David,

Many thanks for your reply, it tells me that I did not miss anything.
And the workaround is okay for now. Any idea when you anticipate to have such functionality build in?

Regards, Sidney

Locked