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

Alex_Puz

Member
Licensed User
Longtime User
Great! Thank you so much. Sure will donate... Let me earn a little of what I am doing.. If do same with Pie that what give me happy and many others
 

abarnett

Member
Licensed User
Longtime User
Hi Johan
In the Pie chart I need event of any segment to return index and value also need click event on the label in center.
In the Radar chart, I need assign to any concentric rings any color and width also with show point should be event to return index and value of point. All of those events need to start others subs
Thank you.
Hi Johan
Fab library. I'm using v1.06 multi line chart and can only get max of 7 rather that 10 lines. Any ideas

Cheers Andrew
 

Johan Schoeman

Expert
Licensed User
Longtime User
Hi Johan
Fab library. I'm using v1.06 multi line chart and can only get max of 7 rather that 10 lines. Any ideas

Cheers Andrew

You are probably missing something in your code to show 10 lines. Attached is an example:

 

Attachments

  • b4aMPMultiLineChartV5.zip
    379.9 KB · Views: 265

abarnett

Member
Licensed User
Longtime User
Thanks for the example. Found the problem. You were right I was missing a value.

Andrew
Hi Johan,

Would you have any ideas why the animate of the multi line would not be fluid. I have been working on 4 channels but just increased to 8 channels and the plotting of the chart which was very smooth and customer loved it is now not. I have tried the animation time from 2000 to 500 and it has not helped. Would be nice to get it back to fluid.

Thanks
Andrew
 

abarnett

Member
Licensed User
Longtime User
Strange. I tested with your V5 example above and its not animated either, even though I can see the animate is set in code.

Donation made by the way..

Thanks
Andrew
 

Johan Schoeman

Expert
Licensed User
Longtime User
Strange. I tested with your V5 example above and its not animated either, even though I can see the animate is set in code.

Donation made by the way..

Thanks
Andrew


Andrew, please upload a sample project so that I can see what is happening in your project with the animation. Else send me a Dropbox link in a PM where I can download your project from.
 

abarnett

Member
Licensed User
Longtime User
Have uploaded the same program to another tablet and it animate fine. I will do some more investigation.

Thanks
Andrew
 

tufanv

Expert
Licensed User
Longtime User
Andrew, please upload a sample project so that I can see what is happening in your project with the animation. Else send me a Dropbox link in a PM where I can download your project from.
Dear Johan,

Thanks for the lib. I have used the updated line and barchart example in my app. There are 12 datas as float from 3.70 to 4.00 but all the data on the graph is rounded to 4. I also tried with the latest lib 1.06 but it still shows them rounded. Any idea ?
 

Johan Schoeman

Expert
Licensed User
Longtime User
Can you maybe upload a sample project and I will then look into it.
 

LouFromDetroit

Member
Licensed User
Longtime User
I notice that this feature does work OK:
mlc5.NoOfMarkerDigits= 3 'or any number

But it seems to revert to the EU style where the 1,279 would show as 1.279 and a decimal like 55.25 will show as 55,25

Is there a localization for this setting?

Note -this was using the mulitlinechart

Thanks.
 
Last edited:

beaker

Member
Licensed User
@LouFromDetroit I have the same issue with the MLC. I brought it up in post #146 in this same thread just under a year ago but Johan wasn't able to help. My app still has the same problem a year later! We've got 4 devices (2 HTC, 1 Samsung & 1 Tesco Hudl) here and it's the same on all devices.
 

Johan Schoeman

Expert
Licensed User
Longtime User

I will post the Java code as it is at present. Please feel free to change it to accommodate your requirements and then recompile it into a new library. Doing a wrappper for a specific project does not mean that one should go and change the original code to accommodate special requirements. If you want to do so then you are more than welcome. I have wrapped what is available and added numerous additional features that were not available in the original Github project. So, if I post the code will you be able to amend it and then recompile it? Else there is no sense in me posting the Java code...
 

beaker

Member
Licensed User

Sorry Johan, thanks for the offer of posting the Java code but I'm afraid that wouldn't do me any good (I just don't get on with Java at all. That's why I use B4A!). I think you might have misunderstood the issue as I don't think either myself or LouFromDetroit are asking for anything special. In my locale (UK) the decimal separator is a "." and the thousands separator is a ",". The axis labels show correctly according to my locale but the markers don't. I have accepted this as a bug and because nobody else seemed to have the same problem I didn't bother you any further with it. When I saw that LouFromDetroit appeared to be experiencing the same issue I thought I'd let him know that I have the same issue.
 

Johan Schoeman

Expert
Licensed User
Longtime User
Here is the Java code - change it to accommodate your requirement. Note that the wrappers alone are in excess of 16 000 lines of code (this excludes the code in the original project + what I have amended / added to the original code). Enjoy!

Just by the way - it took just about 18 months of work to get to the last set of library files that I have posted - in my free time. I am giving it to you for free to change to your liking.
 

Attachments

  • src.zip
    292.9 KB · Views: 172

beaker

Member
Licensed User

Thanks Johan. Even though I didn't have much hope of finding what I was looking for in the Java code you posted I think I might have found the piece of code that's responsible for the incorrect characters. I've found the following in the "formatNumber" function (in Utils.java) which is hard-coded to use commas as a decimal separator and the full-stop as a thousands separator:

B4X:
            // add decimal point
            if (charCount == digitCount) {
                out[ind--] = ',';
                charCount++;
                decimalPointAdded = true;

                // add thousand separators
            } else if (separateThousands && lval != 0 && charCount > digitCount) {

                if (decimalPointAdded) {

                    if ((charCount - digitCount) % 4 == 0) {
                        out[ind--] = '.';
                        charCount++;
                    }

                } else {

                    if ((charCount - digitCount) % 4 == 3) {
                        out[ind--] = '.';
                        charCount++;
                    }
                }
            }
Now, although I think I've found it I have no idea how to make it conform to the current locale or to then compile it into a library!
 

LouFromDetroit

Member
Licensed User
Longtime User
I did confirm that the main Y axis works OK for the settings using
mlc4.YaxisLeftNumberOfDigits = 1 'or any other number

So the end issue is a mismatch in the axis vs the marker for the separators.
That issue withstanding, it is still a very awesome effort from your side.
I will donate if my project turns to be successful.
 

Johan Schoeman

Expert
Licensed User
Longtime User
Post some screenshots of what you see and I will see if I can address it. I don't think the original Githib post makes provision for Locale but I will look into it once I understand the issue
 

wimpie3

Well-Known Member
Licensed User
Longtime User
Is it possible to paint the background below some values? Like the green color I've added here?
 

Attachments

  • green.png
    40.6 KB · Views: 151
Cookies are required to use this site. You must accept them to continue using the site. Learn more…