Sub B4XTable1_DataUpdated
For i = 0 To B4XTable1.VisibleRowIds.Size - 1
Dim RowId As Long = B4XTable1.VisibleRowIds.Get(i)
Dim pnl As B4XView = GraphColumn.CellsLayouts.Get(i + 1) '+1 because of header layout
Dim ChartParent As B4XView = pnl.GetView(1)
If RowId > 0 Then
ChartParent.SetLayoutAnimated(0, 0, 0, pnl.Width, pnl.Height)
ChartParent.Visible = True
Dim Chart As xChart = ChartParent.Tag
Chart.DifferentScales=True '<-------
'this is only needed in B4A as the Base_Resize event will be raised automatically in B4J and B4i.
If xui.IsB4A Then Chart.Base_Resize(ChartParent.Width, ChartParent.Height)
Chart.ClearData
Chart.AddLine("Cases", xui.Color_Blue)
Chart.AddLine("Deaths", xui.Color_Red)
Dim Country As String = B4XTable1.GetRow(RowId).Get(CountryColumn.Id)
AddPointsToChart(CountriesData.Get(Country), Chart)
Chart.DrawChart
Else
ChartParent.Visible = False
End If
Next
End Sub