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

    Wimpie, not sure if the original project allows for this. Do you perhaps know? If there is a method in one of the classes to do so then I will expose it. But a quick search that I have done in the project that I have wrapped does not seem to have such a method.
     
  2. LouFromDetroit

    LouFromDetroit Member Licensed User


    See screenshot. Axis used the dot but the bubble uses the comma for 51,15. Should show 51.15

    Hope this is clear.
     

    Attached Files:

  3. npsonic

    npsonic Active Member Licensed User

    Is it possible to place line chart on the candlestick chart?
    Also is there any way to limit zoom level (Min - Max)?
     
  4. beaker

    beaker Member Licensed User

    Sorry Johan, I have only just seen your reply requesting a screenshot. Although I'm subscribed to this thread, for some reason I wasn't alerted to your post. However I see that @LouFromDetroit has posted a screenshot which demonstrates the issue we're experiencing.
     
  5. Johan Schoeman

    Johan Schoeman Expert Licensed User

    Unfortunately not as the library stands at present unless you superimpose two charts on top of one another with transparency in the right places.
     
  6. Johan Schoeman

    Johan Schoeman Expert Licensed User

    I will see if I can address this issue at some stage when time permits. A bit tied up with my real work and also some projects for forum members.
     
  7. beaker

    beaker Member Licensed User

    Thanks Johan, that would be greatly appreciated.
     
  8. tufanv

    tufanv Expert Licensed User

    Hello,

    I can't find where to set the data which is displayed on candlestrick chart when clicked on a candle , it always shows "4" for me.
     
  9. Johan Schoeman

    Johan Schoeman Expert Licensed User

    What is the range of values on your Y-axis?
     
  10. Johan Schoeman

    Johan Schoeman Expert Licensed User

    Use the attached lib files and in your B4A code add:
    Code:
    mlc1.NoOfMarkerDigits = 3
    mlc1.MarkerToUse = 
    2
    ....before (for eg)....
    Code:
    mlc1.CandleData = Rnd(1,39)
    5.png
     

    Attached Files:

    Last edited: Jul 1, 2017
    Pencil3 and tufanv like this.
  11. Johan Schoeman

    Johan Schoeman Expert Licensed User

    Try with the library files in post #270
     
    beaker likes this.
  12. Johan Schoeman

    Johan Schoeman Expert Licensed User

    See post #271
     
  13. tufanv

    tufanv Expert Licensed User

    Thanks Johan ,

    Now it shows the price of the day :). As I understand it is not possible to also add lowest , highest , open and close prices to data ( manually ) . ? Is there any way to add it or it has to be done from the library itself*
     
    Johan Schoeman likes this.
  14. Johan Schoeman

    Johan Schoeman Expert Licensed User

    Not sure I follow your question above....can you explain what it is that you want to do?
     
  15. tufanv

    tufanv Expert Licensed User

    Currently , when i click on a candle it shows one price , but candle data indeed has 4 values : open ,close , low and high . Is it possible to show all these values like :
    Open : 3.56
    Close 3.57
    High : 3.60
    Low : 3.55
    Date : 2017-01-01

    I also want to add the date for example of the candle that is stored in a listtogether with these 4 values.
     
  16. Johan Schoeman

    Johan Schoeman Expert Licensed User

    Try with the attached library files. Sample project also posted.

    Replace custom_marker_view_2.xml in the /Object/res/layout folder of the B4A project with the attached xml file. Use this xml layout file only for the CandleStickChart.

    Posting the following:
    1. B4A library files V1.07
    2. Sample project
    3. custom_marker_view_2.xml

    You should get this:

    6.png


    The year should be what you have set in the legend. Can probably pick that up too in the Java code and add it to the MarkerView...

    Edit custom_marker_view_2.xml to change the appearance of the MarkerView.

    Not a small change at all to the library to get to this.....
     

    Attached Files:

    Last edited: Jul 1, 2017
    tufanv likes this.
  17. tufanv

    tufanv Expert Licensed User

    Perfect Johan ! Works wonderful. Just a little last question , I think you modify the library so i cant change the language of open,close,high,low and date labels with a different language . Is it possible to change them somehow ?

     
  18. Johan Schoeman

    Johan Schoeman Expert Licensed User

    Try with this (previous post deleted):
    Code:
    mlc1.NoOfMarkerDigits = 3
        mlc1.MarkerToUse = 
    2

        mlc1.MarkerOpenText = 
    "Açık"
        mlc1.MarkerCloseText = 
    "Kapat"
        mlc1.MarkerHighText = 
    "Yüksek"
        mlc1.MarkerLowText = 
    "Düşük"
        mlc1.MarkerDateText = 
    "Tarih"

        mlc1.CandleData = 
    Rnd(1,39)
    Used Google translate so don't expect it to be right....

    7.png
     

    Attached Files:

    DonManfred and tufanv like this.
  19. tufanv

    tufanv Expert Licensed User

    Thanks for all your time spent on this issue ! You were a great help !
     
    Johan Schoeman likes this.
  20. Roberto P.

    Roberto P. Well-Known Member Licensed User

    Hello to all
    I'm trying to use the MPStackedBarChart example with the version 1.07 library, but when I click on the blocks the system goes wrong.

    See the error

    Code:
    *** Service (starter) Create ***
    ** 
    Service (starter) Start **
    ** 
    Activity (main) Create, isFirst = true **
    ** 
    Activity (main) Resume **
    java.lang.NullPointerException: Attempt 
    to invoke virtual method 'boolean anywheresoftware.b4a.BA.subExists(java.lang.String)' on a null object reference
        at com.github.mikephil.charting.charts.BarLineChartBase.getMarkerPosition(BarLineChartBase.java:560)
        at com.github.mikephil.charting.charts.Chart.drawMarkers(Chart.java:
    603)
        at com.github.mikephil.charting.charts.BarLineChartBase.onDraw(BarLineChartBase.java:
    259)
        at android.view.View.draw(
    View.java:16263)
        at android.view.View.updateDisplayListIfDirty(
    View.java:15186)
        at android.view.View.getDisplayList(
    View.java:15209)
        at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:
    3692)
        at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:
    3671)
        at android.view.View.updateDisplayListIfDirty(
    View.java:15146)
        at android.view.View.getDisplayList(
    View.java:15209)
        at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:
    3692)
        at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:
    3671)
        at android.view.View.updateDisplayListIfDirty(
    View.java:15146)
        at android.view.View.getDisplayList(
    View.java:15209)
        at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:
    3692)
        at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:
    3671)
        at android.view.View.updateDisplayListIfDirty(
    View.java:15146)
        at android.view.View.getDisplayList(
    View.java:15209)
        at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:
    3692)
        at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:
    3671)
        at android.view.View.updateDisplayListIfDirty(
    View.java:15146)
        at android.view.View.getDisplayList(
    View.java:15209)
        at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:
    307)
        at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:
    313)
        at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:
    352)
        at android.view.ViewRootImpl.draw(ViewRootImpl.java:
    2818)
        at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:
    2638)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:
    2226)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:
    1230)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:
    6748)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:
    777)
        at android.view.Choreographer.doCallbacks(Choreographer.java:
    590)
        at android.view.Choreographer.doFrame(Choreographer.java:
    560)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:
    763)
        at android.os.Handler.handleCallback(Handler.java:
    739)
        at android.os.Handler.dispatchMessage(Handler.java:
    95)
        at android.os.Looper.loop(Looper.java:
    145)
        at android.app.ActivityThread.main(ActivityThread.java:
    6134)
        at java.lang.reflect.Method.invoke(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:
    372)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:
    1399)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:
    1194)
    thanks
     

    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