Strip chart and plotkit

8 views
Skip to first unread message

Charlie

unread,
Jun 27, 2008, 4:09:44 PM6/27/08
to plotkit
I am looking to create a strip-chart (history of ping times to a node)
using plotkit.

It is mostly working, but the y-labels look strange.

On load, I have a simple line chart that I re-draw into the same
canvas every second.

I use plotter.clear() to clear the plot before doing the next
render(). [This does not seem necessary but it is there].

The graphs all update nicely. But, the axes labels get darker and
darker with each refresh and the text gets a bit grainy around the
numbers. I suspect that the labels are not cleared properly between
refreshes.

Is there something I should do to make sure that the layout/canvas is
cleared before the next render cycle?

I'm a newbie so please forgive me if this is obvious.

Thanks in advance,

Charlie

Charlie

unread,
Jun 28, 2008, 9:45:12 PM6/28/08
to plotkit
Nevermind on this question. I did a plotter.clear() on a new
instance that was connected to the same canvas. Once I reused the
original plotter, it worked fine.

Per Cederberg

unread,
Jun 29, 2008, 3:01:27 AM6/29/08
to plo...@googlegroups.com
The labels are not actually placed in the canvas (since canvas doesn't
support text), but instead as absolutely positioned div elements above
it.

Looking at the canvas.js code, it looks like all the generated divs
are removed in the clear() method. But perhaps you could try with a
bit of Firebug debugging to see what happens?

Cheers,

/Per

Reply all
Reply to author
Forward
0 new messages