cpu loading heavy when mousemove on my chart (using excanvas)

4 views
Skip to first unread message

chinghunglai

unread,
Jul 4, 2008, 4:38:32 AM7/4/08
to google-excanvas
Hello Sir :
I draw a stock chart by excanvas.
my code looks like :
***************************************************************************************
mt.ctx.beginPath();
mt.ctx.moveTo(mt.cleft, mt.ctop + mt.cRowHeight*3);
for (var i=1; i<ts.length-1; i++){
var x = getX(mt, i);
var y = getY(mt, ts[i].trade);
mt.ctx.lineTo(x, y);
}
mt.ctx.stroke();
***************************************************************************************
ts.length is 270 and my chart have 2~3 part code like this , so it has
540~810 moveTo(), lineTo()...

it work very nice, i draw a chart use only 40ms at my computer

but when my mouse move over the stock chart, my cpu loading become
very very heavy (almost 80~90%)

it looks like something is very busy at movemouse event. (but i didn't
implement the mousemove event)

Can anyone help me plz ?

Sorry for my bad english, many thanks for your reading...
Reply all
Reply to author
Forward
0 new messages