I have found the answers myself, let me share them for anybody who may be having the same problems.
Use
var
, notval
Use the LineChart type, not XYChart
Specify the chart axes types
Use
javafx.scene.chart.LineChart
, notscalafx.scene.chart.LineChart
(would be nice if anybody could suggest the right way with ScalaFX though)
Wrong:
private val lineChart: XYChart = _
Right:
private var lineChart: LineChart[Number, Number] = _
Use
lineChart.getData.add(series)
, notlineChart.data.set(series)
Set
fx:controller
to the controller full name in the FXML code (not added by Scene Designer)
It works as expected then.