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

    Johan Schoeman Expert Licensed User

    Will have to amend the library to do so. Will try to get to it sometime this week.

    JS
     
  2. kevinl

    kevinl New Member Licensed User

    Much appreciated Johan, thank you in advance!
     
  3. Johan Schoeman

    Johan Schoeman Expert Licensed User

    Here you go - lib files attached. It should show as V1.13 in the B4A IDE libs tab

    Just set the marker to use to 0

    Code:
    mlc1.MarkerToUse = 0
    I suggest you leave the files in the /Objects/res/layout and Objects/res/drawable folder. They are however not required to be there when MarkerToUse is set to 0 but when setting MarkerToUse to any other value they MUST be there.

    I have applied this change to all the graph types in the library.

    JS
     

    Attached Files:

    zolive33 and icarus like this.
  4. kuosda

    kuosda Active Member Licensed User

    Hello Johan Schoeman
    Can multiple lines of different arrays be done?
     
  5. Johan Schoeman

    Johan Schoeman Expert Licensed User

    Do you mean different array size? If this is what you mean the the answer is no - unfortunately not.
     
  6. kuosda

    kuosda Active Member Licensed User

    It’s a pity! If you have it, it's great.
    Will you try it?
     
  7. Johan Schoeman

    Johan Schoeman Expert Licensed User

    Attached is the Java code. You are welcome to give it a try.
     

    Attached Files:

    Johan Hormaza likes this.
  8. kuosda

    kuosda Active Member Licensed User

    Thanks! Johan Schoeman
    Although my java code knowledge = 0, but I try my best
     
  9. MAGAREY

    MAGAREY Member Licensed User

    its possible to add animation to the pie chart?
     
  10. jtare

    jtare Active Member Licensed User

    Is there any solution to this? Searching I found that there is a way to combine charts, but there is only the same example of bar charts and lines charts, not candlestick and lines or candlesticks and points.
    Thanks.

    Seems possible: https://github.com/PhilJay/MPAndroi...per/mpchartexample/CombinedChartActivity.java

    EDIT:
    I got it to work. I edited the source code from the combine bar chart and line chart. Now I can draw a candlestick chart and a line chart. Now I will try candlestick+multiline+multibubble+multiscatter.
     
    Last edited: Aug 17, 2018
  11. liurenwoxing

    liurenwoxing Member Licensed User

    Hi,
    As the below pic,why the MarkerDigits is "," instead of "." ?

    [​IMG]
     
  12. loonet

    loonet Member Licensed User

    Hi everybody, Is there any way to set the color of crosshair cursor lines ?
    Thanks !
     
  13. Johan Schoeman

    Johan Schoeman Expert Licensed User

    Have not looked at the lib in a very long time but from memory it takes the color of the line/chart that you have clicked on. This lib is probably outdated and someone can perhaps try and wrap the latest version of this Github project and in all probability do it far better than what I have done. Done this in my early days of trying to do wrappers.
     
    Johan Hormaza and loonet like this.
  14. loonet

    loonet Member Licensed User

    Thanks, its outdated but anyway usefull. Thanks for your reply
     
  15. Johan Schoeman

    Johan Schoeman Expert Licensed User

    Use the attached lib files (copy them to your additional libs folder. Have added the ability to set the color and the width of the cross hair to multilinecharts, radarcharts, and linecharts (single) for now.

    Lib should show as V1.14

    Example code from multilinechart:
    Code:
    mlc1.HighlightLineWidth = 2.0f
        mlc1.CrossHairColor = 
    Array As Int(Colors.White, Colors.Yellow, Colors.White, Colors.Yellow, Colors.White, Colors.Yellow, Colors.White, Colors.Yellow, Colors.White, Colors.Yellow)
        
        mlc1.setLineData(
    10,37)
    I need to do some method naming changes in the library at some time or another...:eek:
     

    Attached Files:

    loonet and Pencil3 like this.
  16. loonet

    loonet Member Licensed User

    Thanks so much Johan ! I really appreciate the favor you gave me
     
  17. mico

    mico Member Licensed User

    Hi Johan,

    Thank you for this great library. I am stuck at getting values from a listview, can you help?

    I have two listviews, one for x's and the other for y's. I can succesfully add items and log the values they took with this code:
    Code:
    For i=0 To x_list.Size-1 Step 1
    m=x_list.GetItem(i)
    Log(m)
    Next

    For j=0 To y_list.Size-1 Step 1
    n=y_list.GetItem(j)
    Log(n)
    Next
    But I cannot define these values as x labels and y values in the multiline chart. Is there a way to do it? How can I transfer my "x" values in
    Code:
    chart.XaxisLables = Array As String()
    and "y" values in
    Code:
    chart.Chart_1_Data= Array As Float()
    using my values from the related listviews.

    Thanks for any help.

     
    Last edited: May 8, 2019
  18. Johan Schoeman

    Johan Schoeman Expert Licensed User

    Solved in the PM that you have sent me.
     
    Johan Hormaza likes this.
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