I am currently learning JavaFX and am trying to create an app that shows a line chart and allows the user to change certain variables which then changes the plotted line. T
This issue could also happen if you have :
animated="true"
set for your line chart.
When the class XYChart checks for duplicates, it takes all the series from displayedSeries and compares them with your existing data series. During this time, if you have cleared the data, the series will still be in the displayedSeries due to the prolonged fading effect and result in the "duplicate series added" error.
If that is the case, simply set :
animated="false"