Android Question [SOLUTION] xChart and CustomListView

giggetto71

Active Member
Licensed User
Longtime User
Hi,
I am trying to use the beutiful @klaus xChart view (https://www.b4x.com/android/forum/threads/b4x-xui-xchart-class-and-b4xlib.91830/
) within a CustomListView. so far so good.
Now I would like to "point" to a specific CLV item xchart to update it with coming values.
The method I use in general to identify the objects within a CLV is to use the below code

B4X:
Dim TempLbl As Label, v As B4XView
v=CLV1.GetPanel(CLV1ItemIndex).GetView(0).GetView(panel1index).GetView(PanelDashTextIndex).GetView(DashScrollText1Index)
TempLbl = v
TempLbl.Text = "23 °C"

I have tried to use the same approach (something like)

B4X:
Dim TempxChart As xChart, v As B4XView
    
v=CLV1.GetPanel(index).GetView(0).GetView(panel1index).GetView(PanelDashTextIndex).GetView(GraphIndex)
TempxChart = v
TempxChart.Title = "TestTitle"

but it does not work and it crashes complaining

java.lang.RuntimeException: Field: ba not found in: anywheresoftware.b4a.BALayout

any idea? does anyone has tried to use xGraph within a CLV?
 

Alexander Stolte

Expert
Licensed User
Longtime User
v=CLV1.GetPanel(index).GetView(0).GetView(panel1index).GetView(PanelDashTextIndex).GetView(GraphIndex)
Try this.
B4X:
TempxChart=CLV1.GetPanel(index).GetView(0).GetView(panel1index).GetView(PanelDashTextIndex).GetView(GraphIndex).Tag
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
1668177761467.png

Instead of making the title with "Solved" mark the post as solution :D
 
Upvote 0
Top