Hi,
I am using ABM 4.03 and have not upgraded to 4.25
I create an ABMChart as follows in the ConnectPage. Then I read the values from database and thenn update/refresh the graph
Unfortunately, I don't see any changes in the graph.
Any help will be appreciated.
I am using ABM 4.03 and have not upgraded to 4.25
I create an ABMChart as follows in the ConnectPage. Then I read the values from database and thenn update/refresh the graph
B4X:
public Sub ConnectPage()
...
...
Dim MyContainer As ABMContainer
MyContainerInitialize(page, " MyContainer","tabpagewhite")
Dim chartSales As ABMChart
chartSales.Initialize(page, "chartSales", ABM.CHART_TYPEBAR, ABM.CHART_RATIO_GOLDENSECTION, "chart4theme")
' set some options
'chartSales.OptionsBar.AxisXOnlyInteger=True
chartSales.OptionsBar.StackBars = True
chartSales.OptionsBar.HorizontalBars = True
' add the labels
chartSales.AddLabels(Array As String("Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "Jan", "Feb", "Mar"))
' add some series
Dim Serie4A As ABMChartSerie
Serie4A.InitializeForBar
' Initial values Zero, later these values are read from database and then updated in the graph
Serie4A.SetValues(Array As Int(0,0,0,0,0,0,0,0,0,0,0,0))
chartSales.AddSerie(Serie4A)
chartSales.OptionsBar.AxisYShowLabel=True
' add the chart to the cell
MyContainer.Cell(5,1).AddComponent(chartSales)
..
..
'Here in this Sub I read the real values from Database
CallSubDelayed2(Me,"GetMyValues","SomeValues")
End Sub
Sub GetMyValues(Target As String)
Dim SQL As SQL = DBM.GetSQL
'Get the Values from Database via SQL and filled the values in an Array of Int
Dim nValues() As Int = Array As Int ( 10,20,30,40,50,60,70,80,90,100,110,120)
DBM.CloseSQL(SQL)
Dim MyContainer As ABMContainer = page.Component("MyContainer")
Dim chartSales As ABMChart = MyContainer.Component("chartSales")
chartSales.RemoveSerie("A")
Dim DataSerie As ABMChartSerie
DataSerie.InitializeForBar
'Set the values with the values that you read from the database
DataSerie.SetValues( nValues )
chartSales.AddSerie(Serie4A)
chartSales.Refresh
End Sub
Unfortunately, I don't see any changes in the graph.
Any help will be appreciated.