Android Question Dynamically plot line graphs based on user input change.

Meigionel TS

Member
Licensed User
Is there a way to plot line graphs in B4A dynamically? What I mean is, taking inputs of two editbox where the first edit box would represent x axis value and the second edit box would represent y axis value, and with a button event the graph replots with the new values. And when the app starts it would always be a blank graph with no plots. I wrote a program in python using matplotlib which allows us to do such things, but here I could not find any example of how to proceed with the problem.
 

eurojam

Well-Known Member
Licensed User
Longtime User
Hi welcome to the forum,
if you are familiar with matplotlib you can try to use ABExtDrawing Library, which is very powerfull,but it is not just a Chart-Library: https://www.b4x.com/android/forum/threads/abextdrawing-1-0.14638/
then there are serveral other chart possibilities:
google chart service (only online with internet connection): https://www.b4x.com/android/forum/threads/add-charts-with-google-charts-service.39197/
or
MPAndroidCharts: https://www.b4x.com/android/forum/t...-most-recent-library-files-in-post-322.58017/
or...

best
stefan
 
Upvote 0

Meigionel TS

Member
Licensed User
I get the part where we can plot a graph when the activity starts, but it is static, I cannot understand how to redraw or insert new data (x/y values) to the existing graph when someone adds new values in an editbox and clicks a button.

Do we have any example code from where I can take reference from?
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
When you have new data you need to clear the current graph and redraw it.
You may have a look at the B4A User's Guide, there you have a chapter treating this subject, link in my signature.
You could also have a look at the Oscilloscope project.
 
Upvote 0
Top