PlotKit chart in <table> cell works in FF, not in IE

6 views
Skip to first unread message

wwwillem

unread,
Oct 15, 2008, 1:45:24 PM10/15/08
to plotkit
This was mentioned before, but I couldn't find a response or solution.

The problem is not that you can't put your PlotKit chart in a table
cell, but if you put the canvas and the code that generates the chart
in one and the same table (could be different cells, doesn't matter)
IE refuses to draw the chart.

So (in shorthand HTML :-) this goes wrong in IE (OK in FF):

<table>
<tr><td><div><canvas .....></div></td></tr>
<tr><td><div><script lang="JavaScript">.... </script></div></td></
tr>
</table>

And this is OK:

<table>
<tr><td><div><canvas .....></div></td></tr>
</table>
<table>
<tr><td><div><script lang="JavaScript">.... </script></div></td></
tr>
</table>

But then again, this refuses to work properly again:

<table><tr><td>
<table>
<tr><td><div><canvas .....></div></td></tr>
</table>
<table>
<tr><td><div><script lang="JavaScript">....</script></div></
td></tr>
</table>
</td></tr></table>

This third scenario is what you quickly get if you use PlotKit in
combination with a CMS system. There are normally quite some
enveloping tables that layout the page.

Anybody knows of a fix? If I can't get around this, IE is still
important enough that I will have to drop PlotKit. Which would be a
pity.

Willem

Per Cederberg

unread,
Oct 16, 2008, 4:25:07 AM10/16/08
to plo...@googlegroups.com
What happens if you move the script tag to the page header? Or at
least directly inside the body element. Also, you might consider
executing JS code after the onload event has triggered instead of
inlining it directly inside the page (which executes immediately). My
guess would be that the problem here is a timing/redraw issue in IE.
So you should really wait until the page is fully loaded before using
PlotKit.

Cheers,

/Per

wwwillem

unread,
Oct 14, 2008, 5:41:52 PM10/14/08
to plotkit
Reply all
Reply to author
Forward
0 new messages