Sub createlineChart(nTime As Double, nDistance As Int)
' The label is already set using the scene builder - but here to show how to change these
' XAxisJO.RunMethod("setLabel",Array As Object("Time"))
' YAxisJO.RunMethod("setLabel",Array As Object("Km/Hr for " & nDistance))
' Clear the data from the line chart by using remove the series javaobject
' Check if data is available
If LCGetDataJO.IsInitialized Then LCGetDataJO.RunMethod("remove",Array As Object(SeriesJO))
' Check distance and time. if zero then do nothing
If nTime = 0 Then Return
If nDistance = 0 Then Return
' Define the data series and set the name
SeriesJO.InitializeNewInstance("javafx.scene.chart.XYChart.Series",Null)
SeriesJO.RunMethod("setName",Array As Object("Time/Speed for " & nDistance & "m"))