On 3/15/07, francine <[EMAIL PROTECTED]> wrote:
>     var reserv = MochiKit.DOM.getElement("cmvv");

Not seeing this ID anywhere else.

> In the html page somewhere this node is placed:
> <div id="container" style="width: 520px; height:300px; padding-top:
> 0px;"></div>
>
> This works fine in Firefox. If i try Safari several things seem to go
> wrong. First, the html node has to be placed within a <div id="body"></
> div> and a <canvas id="mgraphic"></canvas> has to be present before
> the canvas shows anything. If i create the node with the 'container'
> div, only the axis values are shown.

You must have a <canvas> tag contained in a <div> for PlotKit to work.
The canvas tag doesn't provide text rendering, so they have to be
created as DOM nodes. The <div> acts as a container for these DOM
nodes.

> The 'if .. else' seems to only way to clear the canvas before
> redrawing the graph, else the values along the axis mingle - don't get
> refreshed. Calling a chart.clear() somewhere in the cicle is useless,
> perhaps because the 'graph' gets remade with 'new'
> PlotKit.SweetCanvasRenderer. It would be nice to be able to refresh
> the canvas and axis in the combination.

You don't have to (and probably shouldn't) create a new layout and
renderer every time. Use the removeDataset method on the layout and
then addDataset the new data then layout.evaluate(), chart.clear(),
chart.render().

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to