A timeline ago...
I just remembered that I did this before around 2013, wrapping up google charts for a b4a project I was working on then and now I need similar for my other ABMaterial project I'm doing.
So I copied the code over to an ABMaterial class and 90% of it just worked. As the class covered quite a lot of google charts varieties, a few when tested did not budge, a lot has changed anyway. For now I just need the organizational chart and will relook the code as I see some funy borders around the chart itself, otherwise it is as expected..
I just remembered that I did this before around 2013, wrapping up google charts for a b4a project I was working on then and now I need similar for my other ABMaterial project I'm doing.
So I copied the code over to an ABMaterial class and 90% of it just worked. As the class covered quite a lot of google charts varieties, a few when tested did not budge, a lot has changed anyway. For now I just need the organizational chart and will relook the code as I see some funy borders around the chart itself, otherwise it is as expected..
B4X:
Sub cmdOrgChart_Click
clsGoogleChart.Initialize(page,"chart")
clsGoogleChart.Title = "My Organization"
clsGoogleChart.Width = 400
clsGoogleChart.Height = 300
' define the data table structure
clsGoogleChart.OrgChartReset
clsGoogleChart.allowHtml = True
clsGoogleChart.allowCollapse = True
clsGoogleChart.nodeClass = ""
clsGoogleChart.selectedNodeClass = ""
clsGoogleChart.NodeSize = clsGoogleChart.NodeSizeEnum.NodeSmall
clsGoogleChart.AddPerson("Mashiane & Sikelela", "Parents","", "red", "Y")
clsGoogleChart.AddPerson("Sponge Bob", "Friend", "Usibabale", "blue", "y")
clsGoogleChart.AddPerson("Usibabale", "Boy", "Mashiane & Sikelela", "blue", "y")
clsGoogleChart.AddPerson("Olothando", "Girl", "Mashiane & Sikelela", "orange", "y")
clsGoogleChart.AddPerson("Esona", "Girl", "Mashiane & Sikelela", "green", "y")
clsGoogleChart.AddPerson("Hello Kitty", "Show", "Olothando", "opaque", "y")
clsGoogleChart.AddPerson("Ben 10", "Show", "Esona", "pink", "y")
'clsGoogleChart.Legendposition = clsGoogleChart.LegendPositionEnum.Right
'clsGoogleChart.BackgroundColor = "white"
'clsGoogleChart.enableInteractivity = True
'clsGoogleChart.Animate = True
clsGoogleChart.SaveToo = True
'clsGoogleChart.isStacked = True
clsGoogleChart.ChartType = clsGoogleChart.ChartTypeEnum.OrgChart
page.Cell(4,1).AddComponent(clsGoogleChart.ABMComp)
End Sub
Attachments
Last edited: