I need a B4X component with which I can draw graphs for at least one variable.
The attached image represents an idea of what I would need. Google Chart is a variant but I would prefer something more customizable.
I tried to use the library you specified in a simple B4I program. I included the library in the additional folder and included it in the project. I have included in the page layout the xChart component and I have copied the example given.
B4X:
PieChart1.ClearData
Private i, Values(4) As Int
For i = 0 To 3
Values(i) = Rnd(50, 501)
Next
PieChart1.AddPie("Slice #1", Values(0), xui.Color_Blue) '0 = random color
PieChart1.AddPie("Slice #2", Values(1), xui.Color_Red)
PieChart1.AddPie("Slice #3", Values(2), xui.Color_Yellow)
PieChart1.AddPie("Slice #4", Values(3), xui.Color_Cyan)
PieChart1.DrawChart
Yes, I made the change with the pie.
Very strange ... if I move all the code on the first page of the application it works, in none of the other NO!
In Main I have:
B4X:
Sub Button1_Click
Charts.Show
End Sub
where Charts is a second page.
B4X:
Public Sub Show
If pg.IsInitialized = False Then
pg.Initialize("pg")
pg.RootPanel.LoadLayout("ChartLayout")
pg.HideBackButton = True
End If
Main.NavControl.ShowPage(pg)
Main.NavControl.ToolBarVisible = False
DateTime.DateFormat = "dd/MM/yyyy"
PieChart1.ClearData
Private i, Values(4) As Int
For i = 0 To 3
Values(i) = Rnd(50, 501)
Next
PieChart1.AddPie("Slice #1", Values(0), xui.Color_Blue) '0 = random color
PieChart1.AddPie("Slice #2", Values(1), xui.Color_Red)
PieChart1.AddPie("Slice #3", Values(2), xui.Color_Yellow)
PieChart1.AddPie("Slice #4", Values(3), xui.Color_Cyan)
PieChart1.DrawChart
End Sub
I use B4I last version and the included libraries are in the attached pictures.