0

When I load a data series into my LineChart, like linechartVar.getData().addAll(series);

I get the intended result: add series to linechart

Than, I load the same series to my AreaChart and at the same time I disable LineChart visibility. So I get this: add same series to areachart

But when I switch back to my LineChart (so disable AreaChart visibility and enable LineChart visibility) I get this: just called setVisible(false) on areachart and setvisible(true) on linechart (symbol dots are gone)

Why is that? Any help is very much appreciated.

Maybe good to know: XYChart series remains the same in the process and it is only added to Area and LineChart only once. But what I noticed is if I recalculate the XYChart series all the time I switch between these two charts the problem won't occur. (But I do not want to recalculate the series over and over again because it is always remains the same. The only thing I wanted to change is the chart "type".)

I do not understand what can cause this behavior.

Ricky
  • 553
  • 6
  • 21
  • [mcve] please ... – kleopatra Aug 02 '19 at 01:33
  • Sharing a `Series` between two charts is the likely culprit. There are properties of the `Series` and `Data` classes that only make sense in the context on a _single_ chart. – Slaw Aug 02 '19 at 04:20

0 Answers0