B4A Library MPAndroidCharts - Various type of graphs / charts (Latest library V1.22 in post #1)

Johan Schoeman

Expert
Licensed User
Longtime User
Dear Johan,
This is New Year gift! Thanks a lot and have a great new year!

PS: A slight problem!
The y-axis grid spacing is not linear as seen in the screen shot attached.
It is drawing grid lines for both the left and right y-axis. You are forcing the right y-axis to start at zero but not the left. Set them the same.
 

davidvidasoft

Member
Licensed User
HI Johan. I am having some problems implementing the library (v1.12). I have replicated the code of your example but when I run the app I get this



In that line of code is located this:
B4X:
mlcCurrent.LineData = 12   'this number must be the same as the number of elements in the above arrays
Can I have some help here? I've attached my source code
 

Attachments

  • proj.zip
    9.3 KB · Views: 256

davidvidasoft

Member
Licensed User
Hi again @Johan Schoeman, I was wondering if it's possible to add new data to the charts. I successfully updated the data in my line chart through a button but can't add new values. How should I do it? I'm asking this because my line chart will work with a combobox as date filter and not all the datasets will have the same length.

EDIT: Ok, it's working as intended. I just needed to also update the legendText to fit the new range of my data.
 
Last edited:

Joe73

Active Member
Licensed User
Hello,
the following is possible:?
I want the initial value for a zoom of the X-axis to be
and end value of the current display.
With these values I want to change the labels.
For example, display the date of individual days without zoom and display the date with zoom at the beginning and end and the hours or minutes in between.
Is that possible?
Possibly also 2 lines of labels...?

Many greetings from Jürgen

Translated with www.DeepL.com/Translator
 

Johan Schoeman

Expert
Licensed User
Longtime User
Unfortunately not Jurgen. Not unless I go and spend a whole lot of time on the original project that I have wrapped and try to add some additional code to it. Not something that I have on my agenda in the near future.

Rgds

Johan
 

rtek1000

Active Member
Licensed User
Longtime User

Hello guys

How can I add more buttons?
I duplicate the code's instructions and via Designer, but when the graphic is loaded, the additional buttons are hidden.

 

rtek1000

Active Member
Licensed User
Longtime User
Hello,

How to limit the amount of decimal digits in the Y axis?

I was able to leave the graph with the fixed scale (YaxisRightMaxVal = YaxisLeftMaxVal and YaxisRightMinVal = YaxisLeftMinVal),
but when the data is very close to the beginning of the scale, the Y axis displays more decimal digits.

For example, with data near the end of the scale, the Y axis displays the value "5.0" but when the data is close to the beginning of the scale, the Y axis displays the value "5.0000". When this occurs, the graph automatically adjusts its aspect ratio, making it look like a display defect when it ranges from "5.0" to "5.0000".

(P.S.: Using lib v5)
 

Johan Schoeman

Expert
Licensed User
Longtime User
B4X:
mlc1.YaxisLeftNumberOfDigits = 2
mlc1.YaxisRightNumberOfDigits = 1
 

kuosda

Active Member
Licensed User
Longtime User
HI Johan
You are really powerful
But can I draw multiline of different arrays?
as the picture shows
 

Attachments

  • chartLine.jpg
    84.1 KB · Views: 226

Alisson

Active Member
Licensed User
Johan Schoeman,

I used a module to run your code. This is graph:



The code worked perfectly, but the graph does not stay in landscape.
How can I add the landscape mode in the module?

I've attached an image with the code.




Thank you very much.
 

Johan Schoeman

Expert
Licensed User
Longtime User

kevinl

New Member
Licensed User
Longtime User
Dear Johan,

How can I completely disable/hide the marker view when using the multiLineChart?

Thanks and best regards,
Kevin
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…