B4J Tutorial Using JavaObject and JavaFx - LineChart

To help with my own learning I have played with JavaObject and JavaFX to create linecharts.

Here are the 3 examples I have made I have ported the code directly from the Oracle documentation.

The examples are fully documented and require the JavaObject Library.

The Oracle documentaton for LineChart is here.

I hope you find it useful.
 

Attachments

  • 3-1.zip
    1.1 KB · Views: 1,039
  • 3-4.zip
    1.2 KB · Views: 837
  • 3-5.zip
    1.4 KB · Views: 941
Last edited:

positrom2

Active Member
Licensed User
Longtime User
Sorry,stevel05,
I had copied the wrong line. It reads
B4X:
miyaxis1.RunMethod("setAutoRanging",Array As Object(False))
In the designer, the axis got the ID miyaxis and was set to autorange also there.

I think it's quite clear that the zero line will be included in the chart, despite autorange setting (at least when having all negative data, not having tried the other direction).
The program won't run if it is not receiving data from a µC, so posting won't be very useful. For ultimate testing a simple program would be better suited, maybe I will try.
 

ivanomonti

Expert
Licensed User
Longtime User
To help with my own learning I have played with JavaObject and JavaFX to create linecharts.

Here are the 3 examples I have made I have ported the code directly from the Oracle documentation.

The examples are fully documented and require the JavaObject Library.

The Oracle documentaton for LineChart is here.

I hope you find it useful.

I can not find how to remove the point 0 when the values exceed 10 points... how can I create effect oscilloscope with your code!!

Thank 1000
 

stevel05

Expert
Licensed User
Longtime User
I haven't tried it, but the charts are probably not designed to produce animations. Having said that, you could try rebuilding the data set and redraw the whole thing if it's fast enough.
 

Sergiu SIlinc

New Member
Hello guys,
I am new here. I would have a question : Could it be possible to make the charts active, like to be able to change the values while you are seeing the graph ?

Thank you.
 

stevel05

Expert
Licensed User
Longtime User
Hi Sergiu, same answer as post #23, try rebuilding the data set and redraw the graph.
 

Johan Schoeman

Expert
Licensed User
Longtime User
Top