Commit 2d6aa6e9 authored by olau@iola.dk's avatar olau@iola.dk

Add warnings about display:none and placeholder readiness to the README

git-svn-id: https://flot.googlecode.com/svn/trunk@66 1e0a6537-2640-0410-bfb7-f154510ff394
parent 9a197401
...@@ -21,7 +21,7 @@ you take the one bundled with Flot as it contains a bugfix for drawing ...@@ -21,7 +21,7 @@ you take the one bundled with Flot as it contains a bugfix for drawing
filled shapes) which is canvas emulation on Internet Explorer. You can filled shapes) which is canvas emulation on Internet Explorer. You can
include the excanvas script like this: include the excanvas script like this:
<!--[if IE]><script language="javascript" type="text/javascript" src="excanvas.js"></script><![endif]--> <!--[if IE]><script language="javascript" type="text/javascript" src="excanvas.pack.js"></script><![endif]-->
If it's not working on your development IE 6.0, check that it has If it's not working on your development IE 6.0, check that it has
support for VML which excanvas is relying on. It appears that some support for VML which excanvas is relying on. It appears that some
...@@ -44,16 +44,24 @@ this: ...@@ -44,16 +44,24 @@ this:
<div id="placeholder" style="width:600px;height:300px"></div> <div id="placeholder" style="width:600px;height:300px"></div>
You can also do it with an external stylesheet. You can also do it with an external stylesheet. Make sure that the
placeholder isn't within something with a display:none CSS property -
in that case, Flot has trouble measuring label dimensions which
results in garbled looks and might have trouble measuring the
placeholder dimensions which is fatal (it'll throw an exception).
Then on document ready, run the plot function: Then when the div is ready in the DOM, which is usually on document
ready, run the plot function:
$.plot($("#placeholder"), data, options); $.plot($("#placeholder"), data, options);
Here, data is an array of data series and options is an object with Here, data is an array of data series and options is an object with
settings if you want to customize the plot. Take a look at the settings if you want to customize the plot. Take a look at the
examples for some ideas of what to put in or look at the reference examples for some ideas of what to put in or look at the reference
in the file "API.txt". in the file "API.txt". Here's a quick example that'll draw a line from
(0, 0) to (1, 1):
$.plot($("#placeholder"), [ [[0, 0], [1, 1]] ], { yaxis: { max: 1 } });
The plot function immediately draws the chart and then returns a Plot The plot function immediately draws the chart and then returns a Plot
object with a couple of methods. object with a couple of methods.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment