Do I add datasets to the chart or to a renderer? #583
Replies: 1 comment
-
Each renderer renders every dataset that was added to the renderer plus all datasets added globally to the chart. Also by default an If you want to have all renderers processing a chart or have only one renderer (+ maybe a metadata renderer or some other auxiliary renderer), you can add them to the chart directly. If you want to have multiple renderers (usually to have different types or different settings) you probably want to add the datasets to the renderer. Also note that you can always add a dataset to multiple renderers directly. I hope that helps and you enjoy using chartfx. If you have further questions or want to show something you built with the library, feel free to do so. |
Beta Was this translation helpful? Give feedback.
-
Both
Chart
andRenderer
expose agetDatasets()
method. Given adataset
, one way I have found to plot data is to callchart.getDatasets().add(dataset)
. Another way is to callrenderer.getDatasets().add(dataset),
and then callchart.getRenderers().add(renderer)
.Is there any guidance on pros/cons to either approach? The Renderer class is light on documentation so I am a little lost here.
Beta Was this translation helpful? Give feedback.
All reactions