Android Question Realtime Chart options

f0raster0

Well-Known Member
Licensed User
Longtime User
Hello Team,

We're in search of a chart that allows for scrolling, similar to the example provided below. Thanks in advance.

Chart1.jpg
Edit: Link

the closer one supporting horizontal scrolling is this:
 
Last edited:

f0raster0

Well-Known Member
Licensed User
Longtime User
Maybe the xChart library could do it.
A small demo program does exist HERE. It uses a Line chart with two lines updated dynamically, with a scrollbar.
It has a checkbox to allow scrolling.
Thanks, @klaus.
We're currently utilizing the xChart library. I've tested almost all the demos from your threads, except that one, unfortunately, it doesn't run on my phone. I've tried both xChart 9.8 and an older version.

Today, I gave it another shot, and here's the error log. Any thoughts on what might be causing the issue?
Error Demo not touching:
Edit: It compiles now.

Q#2 (I believe I've already read that it cannot be done)
Do you know if it is possible to change the color of the dots upon clicking, reaching the maximum value, or both options?

Chart Dots.jpg

Q#3 - How can I capture the value when clicking on a data point?
ChartDataClick.jpg
 
Last edited:
Upvote 0

klaus

Expert
Licensed User
Longtime User
3. The display panel for the values is hidden every time when a new value is added.
This could be avoided, modifying the code in the class.
But this work correctly only as long as the max. number of data is not reached.
Because all values at a given position in the list remain the same.
But, when the number max of data is reached and a new data arrives, the first one is removed and the new is added.
This means that, when you allow the zoom cursor and the screen is frozen, the real values at a given position in the list change with each new data arriving.
To be able to read the frozen data, it would need two sets of data, the current data and the frozen data.
 
Upvote 0

f0raster0

Well-Known Member
Licensed User
Longtime User
@klaus you chart work great! We successfully retrieve the value upon clicking a point.
1.jpg

The only feature we currently lack for our requirements is Zoom In/Out (when we stop reading data), but for the time being, it meets our needs - maybe one day B4X will have some chart like post#1
Once again thank you very much!
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
The only feature we currently lack for our requirements is Zoom In/Out (when we stop reading data)
What exactly do you mean with "when we stop reading data" ?
Does it mean that you do not add new data during this time ? If yes, this can easily be done.
Or do you want to continue to acquire new data and freeze the data to display ? This will need two data set as explained in my previous post.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Attached two projects:

In DynamicZoom3 you can stops the data acquisition to allow zooming and reading data.
When you read again, the data which come during the stop time are lost.

In DynamicZoom4 you can freeze the currently acquired data to allow zooming and reading these data, but the data acquisition continues.
This uses two data lists.
When you 'unfreeze' the data you get the latest acquired data.
 

Attachments

  • DynamicZoom3.zip
    338.9 KB · Views: 48
  • DynamicZoom4.zip
    338.9 KB · Views: 62
Upvote 0

f0raster0

Well-Known Member
Licensed User
Longtime User
What exactly do you mean with "when we stop reading data" ?
Does it mean that you do not add new data during this time ? If yes, this can easily be done.
We are retrieving data from a Bluetooth module, and we can control the Bluetooth module to stop sending data, then the chart stops receiving new data. Consequently, the current data displayed on the chart can be observed, and further navigation by scrolling left and right is achievable using your chart functionality.

I understand that in your example, "zooming" refers to moving left/right.
We would appreciate having the option to Zoom In/Out, as below:
ideaZoom.gif
 
Upvote 0
Top