This has been driving me crazy for the past 2 days! I should just leave it alone but to anal to do so.
Each time a render a graph (PaintLog) with a collection of values, it takes longer and longer each time (as the log file shows).
Eventually, I call clog.Refresh - where the delay compounds...
By the time I get to the 30th item, it takes about 5 seconds for the series of lines to paint.
Hitting the browser refresh button is the only way to restore the speed (which restores everything).
Any Suggestions?
Thanks
The logs file...
Each time a render a graph (PaintLog) with a collection of values, it takes longer and longer each time (as the log file shows).
Eventually, I call clog.Refresh - where the delay compounds...
By the time I get to the 30th item, it takes about 5 seconds for the series of lines to paint.
Hitting the browser refresh button is the only way to restore the speed (which restores everything).
Any Suggestions?
Thanks
The logs file...
B4X:
Start draw dlog
End draw dlog: 859 ms
Start draw dlog
End draw dlog: 915 ms
Start draw dlog
End draw dlog: 997 ms
Start draw dlog
End draw dlog: 1050 ms
B4X:
Sub PaintLog(stats As List)
Dim clog As ABMCanvas = page.Component("canvasLog")
dlog.Clear
dlog.clearRect(0,0,dlwdt,dlhgt)
clog.RemoveObject("dlog")
Dim ty,tx As Double
ty = y
tx = x
y = ty
x = tx
Dim wdt As Int = 0.9
Dim hgt As Int = 15
Dim cstat As Int
Dim tof,tsb,tdr,ton As Int
dlog.strokeStyleColor("#000000")
y = offy + y - (hgt/2)
x = lbuff -3
stim = DateTime.Now
Log("Start draw dlog")
For i = 0 To stats.Size-1
cstat = stats.Get(i)
Select cstat
Case 1
dlog.beginPath
dlog.moveTo(x+i, y)
dlog.lineTo(x+i, y+hgt)
tof = tof +1
dlog.closePath
dlog.stroke
Case 2
dlog.beginPath
dlog.moveTo(x+i, y+(lbuff))
dlog.lineTo(x+i, y+(lbuff)+hgt)
tsb = tsb +1
dlog.closePath
dlog.stroke
Case 3
dlog.beginPath
dlog.moveTo(x+i, y+(lbuff*2))
dlog.lineTo(x+i, y+(lbuff*2)+hgt)
tdr = tdr +1
dlog.closePath
dlog.stroke
Case 4
dlog.beginPath
dlog.moveTo(x+i, y+(lbuff*3))
dlog.lineTo(x+i, y+(lbuff*3)+hgt)
ton = ton +1
dlog.closePath
dlog.stroke
End Select
Next
y = ty
x = tx
dlog.fillStyleColor(ABM.COLOR_BLUE)
y = offy + y - (hgt/2)+7
x = lbuff -7
'y = y + lbuff
dlog.fillText(ABMShared.ShowTimeFormatMins(tof),x+rectw+(lbuff/1.5),y)
y = y + lbuff
dlog.fillText(ABMShared.ShowTimeFormatMins(tsb),x+rectw+(lbuff/1.5),y)
y = y + lbuff
dlog.fillText(ABMShared.ShowTimeFormatMins(tdr),x+rectw+(lbuff/1.5),y)
y = y + lbuff
dlog.fillText(ABMShared.ShowTimeFormatMins(ton),x+rectw+(lbuff/1.5),y)
clog.AddObject(dlog)
y = ty
x = tx
End Sub