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

fwizardy

New Member
I try to use this chart, but i get index error if i use less than 12 data...

I Use the sample above but i reduce it to only below 12 data and MpChartLib v 1.20 from first post
How i do solve it ? Thank you ?


Error occurred on line: 127 (Main)
java.lang.ArrayIndexOutOfBoundsException: length=10; index=10
at mpandroidchartwrapper.multiLineBarChartWrapper.generateLineData1(multiLineBarChartWrapper.java:388)
at mpandroidchartwrapper.multiLineBarChartWrapper.DrawCharts(multiLineBarChartWrapper.java:337)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:777)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:354)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:157)
at JHS.MPMultiLineBarChart.main.afterFirstLayout(main.java:105)
at JHS.MPMultiLineBarChart.main.access$000(main.java:17)
at JHS.MPMultiLineBarChart.main$WaitForLayout.run(main.java:83)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7698)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
 
Last edited:

Johan Schoeman

Expert
Licensed User
Longtime User
Try with the attached - The library should show as V1.21 in the B4A IDE

Have also posted V1.21 in Post #1 of this thread
 

Attachments

  • mpChartLib.zip
    358 KB · Views: 142
  • b4aMPMultiLineBarChart.zip
    29.5 KB · Views: 130

fwizardy

New Member
Thank you... It Work....
?

As you can see there should be significant digit on chart, but now is not (the show of marker is same without significant digit).
can we have like multilinechart, it will be zero without significant digit if zero, but if there is value, we can set the significant digit.

Or how can i set it ?

Thank you
 

Johan Schoeman

Expert
Licensed User
Longtime User

Try with the attached project and lib files - It should show as V1.22 in the IDE

This is where I leave this project.....

 

Attachments

  • mpChartLibV1.22.zip
    359.2 KB · Views: 150
  • b4aMPMultiLineBarChart.zip
    29.6 KB · Views: 129

mhk1368

Member
hi
I have data as below which has null value in some places, I want this data not to be shown and the chart is divided into several pieces. It means several separate graphs. The number of these points may reach 100 points. How can I do this? I saw somewhere that you posted a solution, but that command doesn't work anymore, and it only removed the zero points.
https://www.b4x.com/android/forum/threads/mpandroidcharts-skipping-a-value.111796/post-697284
https://stackoverflow.com/questions/50407907/how-to-make-empty-space-in-a-linechart

B4X:
mbc1.LegendText = Array As String("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20","21", "22", "23", "24")
mbc1.ChartData = Array As Float(52, null, null, 70, -48, 0, 0, 79, null, 6.05, 5.5, 55, 0, 0, -3, 20, 48.0, 38.0, 25.0, 53.0, 66.0, 46.0, 67.0, 75.0)


 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…