Skip to content
Discussion options

You must be logged in to vote

You can toggle the DataSetNode belonging to that dataset in your ContourDataSetRenderer. This is the same visibility property the built-in legend changes:

DataSetNode series = renderer.getStyleableNode(histogram);
button.setOnAction(event -> series.setVisible(!series.isVisible()));

Call getStyleableNode after adding that exact dataset object to the renderer. If you're adding it there, DataSetNode series = renderer.addDataSet(histogram); returns the node directly. The data stays attached; there's no reload or removal. If it also appears in another renderer, that renderer has a separate node to toggle.

This runnable example uses two external toggle buttons with a hidden legend. Scripted off…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@RobertoRoos
Comment options

Answer selected by RobertoRoos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants