Hi,
I try to use the Johan Charts Library.
I have an error on this line : mrc1.setRadarData(2,8)
"Error occurred on line: 1993 (Main)
java.lang.ArrayIndexOutOfBoundsException: length=2; index=2
at mpandroidchartwrapper.radarChartWrapper.setRadarData(radarChartWrapper.java:272)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:755)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:345)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:166)
at anywheresoftware.b4a.shell.DebugResumableSub$RemoteResumableSub.resume(DebugResumableSub.java:19)
at anywheresoftware.b4a.keywords.Common$13.run(Common.java:1677)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6682)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)"
I don't understand what is wrong...
If somebedy can help me..
Thanks a lot.
FM
I try to use the Johan Charts Library.
I have an error on this line : mrc1.setRadarData(2,8)
"Error occurred on line: 1993 (Main)
java.lang.ArrayIndexOutOfBoundsException: length=2; index=2
at mpandroidchartwrapper.radarChartWrapper.setRadarData(radarChartWrapper.java:272)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:755)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:345)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:166)
at anywheresoftware.b4a.shell.DebugResumableSub$RemoteResumableSub.resume(DebugResumableSub.java:19)
at anywheresoftware.b4a.keywords.Common$13.run(Common.java:1677)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6682)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)"
I don't understand what is wrong...
If somebedy can help me..
Thanks a lot.
FM
B4X:
Sub affiche_stats()
PnlStats.Visible=True
PnlStats.BringToFront
mrc1.ChartDescription = "Axes de travail"
mrc1.ChartDescriptionColor = Colors.White
mrc1.ChartDescriptionTextSize = 12
' RIGHT_OF_CHART, RIGHT_OF_CHART_CENTER, RIGHT_OF_CHART_INSIDE,
' LEFT_OF_CHART, LEFT_OF_CHART_CENTER, LEFT_OF_CHART_INSIDE,
' BELOW_CHART_LEFT, BELOW_CHART_RIGHT, BELOW_CHART_CENTER,
' CIRCLE, SQUARE, LINE
mrc1.LegendShapeSize = 15.0
mrc1.setTheLegendPositionAndForm("BELOW_CHART_CENTER","CIRCLE")
mrc1.TheLegendColor = Colors.yellow
mrc1.TheLegendTextSize = 10.0
mrc1.LegendText = Array As String("jOUEUR 1", "jOUEUR 2")', "2013", "2014", "2015")
mrc1.ValueTextColor = Colors.Black
mrc1.ValueTextSize = 12.0
' mrc1.YaxisMinVal = -400 'commented it out so that the scale will be set automatically
' mrc1.YaxisMaxVal = 1800 'commented it out so that the scale will be set automatically
mrc1.YaxisTextSize = 10.0
mrc1.YaxisTextColor = Colors.White
mrc1.Chart_1_Data = Array As Float(ssp1,ssm1,srp1,srm1,srvp1,srvm1,smp1,smpv1)', -380.2, 345.0)
mrc1.Chart_2_Data = Array As Float(ssp2,ssm2,srp2,srm2,srvp2,srvm2,smp2,smpv2)' 1010.8, 836.4)
'mrc1.Chart_3_Data = Array As Float(836.4, 1010.8, 985.6, 676.5, 1100.0, 730.0, 960.0, 450.0, 750.0, 1200)
'mrc1.Chart_4_Data = Array As Float(345.0, -380.2, -250.4, 849.7, 445.0, 600.5, -300.0, 50.0, 550.0, 1100.0)
'mrc1.Chart_5_Data = Array As Float(1050.0, 850.0, 650.0, 1400.0, 760.8, -450.7, 934.9, 576.2, 896.4, -380.6)
mrc1.XaxisTextColor = Colors.Cyan
mrc1.XaxisTextSize = 12.0
mrc1.ValueTextSize = 10.0
mrc1.ValueTextColor = Colors.Yellow
mrc1.DrawGraphValues = False
' Maximum 5 colors to be passed ==> must be at least equal to the number of data sets that are passed i.e maximum 5
' If you pass only for eg 2 data sets then at least 2 colors need to be passed
' If more that 2 colors are passed with for eg only 2 data sets then only the first 2 colors will be used in the color array
mrc1.GraphLineColor = Array As Int(Colors.Green, Colors.Red)', Colors.Blue, Colors.Green, Colors.Cyan)
mrc1.GraphLineWidth = 2.0
mrc1.DrawFilled = True
mrc1.WebConcentricColor = Colors.Green
mrc1.WebRadialColor = Colors.Red
mrc1.WebAlpha = 200
mrc1.ConcentricLineWidth = 1.5
mrc1.RadialLineWidth = 0.75
mrc1.DrawWeb = True
mrc1.XaxisLables = Array As String("Servir +", "Servir mieux", "Retourner +", "Retourner mieux", "Renvoyer +", "Renvoyer mieux", "Marquer +", "Marquer + vite")', "Distribution OH", "EBITDA")
' the number of charts to be drawn (maximum 5, in this case 3)
' the number of x-axis values per chart (in this case 10 = number of elements in the array passed to mrc1.XaxisLables)
mrc1.setRadarData(2,8)
End Sub