JavaFX LineChart: Insert new data in the middle of the chart
I'm using a line chart with JavaFX: LineChart<Number, Number> lineChart = new LineChart<>(xAxis, yAxis); XYChart.Series series = new XYChart.Series(); lineChart.getData().add(series); I want to add data to the series successively, thereby the order in which the values arrive can not be predicted. For example, the index can be between 0 and the current size of the series. series.getData().add(new XYChart.Data(index, value)); Consider the following scenario: //initializing... series.getData().add(new XYChart.Data(1, 400)); series.getData().add(new XYChart.Data(3, 500)); series.getData().add(new