B4A Library MPAndroidCharts - Various type of graphs / charts (most recent library files in post #362)

Discussion in 'Additional libraries, classes and official updates' started by Johan Schoeman, Sep 5, 2015.

  1. coldtech

    coldtech Member Licensed User

    Great thanks. Donation sent.
     
    Johan Schoeman likes this.
  2. Alex_Puz

    Alex_Puz Member Licensed 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
     
  3. abarnett

    abarnett Member Licensed 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
     
  4. Johan Schoeman

    Johan Schoeman Expert Licensed User

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

    2.png
     

    Attached Files:

  5. abarnett

    abarnett Member Licensed User

    Thanks for the example. Found the problem. You were right I was missing a value.

    Andrew
     
  6. abarnett

    abarnett Member Licensed User

    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
     
  7. abarnett

    abarnett Member Licensed 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 likes this.
  8. Johan Schoeman

    Johan Schoeman Expert Licensed 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.
     
  9. abarnett

    abarnett Member Licensed User

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

    Thanks
    Andrew
     
  10. tufanv

    tufanv Expert Licensed User

    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 ?
     
  11. Johan Schoeman

    Johan Schoeman Expert Licensed User

    Can you maybe upload a sample project and I will then look into it.
     
  12. LouFromDetroit

    LouFromDetroit Member Licensed 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: Mar 5, 2017
  13. beaker

    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.
     
  14. Johan Schoeman

    Johan Schoeman Expert Licensed 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...
     
  15. beaker

    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.
     
  16. Johan Schoeman

    Johan Schoeman Expert Licensed 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.
     

    Attached Files:

    • src.zip
      File size:
      292.9 KB
      Views:
      26
    freedom2000 likes this.
  17. beaker

    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:

    Code:
    // 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 likes this.
  18. LouFromDetroit

    LouFromDetroit Member Licensed 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.
     
  19. Johan Schoeman

    Johan Schoeman Expert Licensed 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
     
  20. wimpie3

    wimpie3 Well-Known Member Licensed User

    Is it possible to paint the background below some values? Like the green color I've added here?
     

    Attached Files:

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice