Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private xChart1 As xChart
End Sub
Public Sub Initialize
End Sub
'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
InitBarData
End Sub
Private Sub InitBarData
Private i As Int
xChart1.AddBar("Voltage", xui.Color_Red) 'adds a bar to the chart
For i = 0 To 400
xChart1.AddBarPointData(i, Rnd(0, 100)) 'adds values to the chart
Next
xChart1.SetZoomIndexes(0, 40) 'this means that 41 values are shown
xChart1.SetZoomSteps(1, 20) 'set the values for the small and big steps of the scrollbar
xChart1.DrawChart 'draws the chart
End Sub