Android Question mpchart setLineData index error

ShadTech

Member
Licensed User
B4X:
    mlc1.XaxisLables= selarrs("minutes_tabletmp"," ifnull(  time_column || ' - (' || CAST(ifnull(tsval, 0) AS REAL)  || ')',0)", "    op="&wrr(B4XPages.MainPage.mainqry)&"   ORDER BY time_column" )
    mlc1.YaxisLeftMaxVal = MyMax(selarrs("minutes_tabletmp","max(ifnull(tsval,0)) sm",wrs ))+3''45000
    Select     B4XPages.MainPage.pgPage4.chts.Length
        Case 1
            mlc1.Chart_1_Data = selarrdbl("minutes_tabletmp"," ifnull(tsval,0)  sm",  "   op="&wrr(B4XPages.MainPage.pgPage4.chts(0))&"        ORDER BY time_column" )
        Case 2
            mlc1.Chart_1_Data = selarrdbl("minutes_tabletmp"," ifnull(tsval,0)  sm",  "   op="&wrr(B4XPages.MainPage.pgPage4.chts(0))&"        ORDER BY time_column" )
            mlc1.Chart_2_Data = selarrdbl("minutes_tabletmp"," ifnull(tsval,0)  sm",  "    op="&wrr(B4XPages.MainPage.pgPage4.chts(1))&"        ORDER BY time_column" )
        Case 3
            mlc1.Chart_1_Data = selarrdbl("minutes_tabletmp"," ifnull(tsval,0)  sm",  "   op="&wrr(B4XPages.MainPage.pgPage4.chts(0))&"        ORDER BY time_column" )
            mlc1.Chart_2_Data = selarrdbl("minutes_tabletmp"," ifnull(tsval,0)  sm",  "    op="&wrr(B4XPages.MainPage.pgPage4.chts(1))&"        ORDER BY time_column" )
            mlc1.Chart_3_Data = selarrdbl("minutes_tabletmp"," ifnull(tsval,0)  sm",  "    op="&wrr(B4XPages.MainPage.pgPage4.chts(2))&"        ORDER BY time_column" )
           
    End Select
 
    LogColor(B4XPages.MainPage.pgPage4.chts.Length,Colors.Red)

    mlc1.setLineData(B4XPages.MainPage.pgPage4.chts.Length,selarrs("minutes_tabletmp"," ifnull(  time_column || ' - (' || CAST(ifnull(tsval, 0) AS REAL)  || ')',0)", "    op="&wrr(B4XPages.MainPage.mainqry)&"   ORDER BY time_column" ).Length)
in that code i got error in setLineData
charts i want to display are 2

the variable B4XPages.MainPage.pgPage4.chts.Length equals=2
when i have index error in setLineData
Note: the index error is in the first paramater of setLineData "numberOfCharts",
not in the second one "NumberOfEntirePerchart"
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…