|
|
|
|
@ -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
|
|
|
|
|
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
|
|
|
|
|
support for VML which excanvas is relying on. It appears that some
|
|
|
|
|
@ -44,16 +44,24 @@ this:
|
|
|
|
|
|
|
|
|
|
<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);
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
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
|
|
|
|
|
object with a couple of methods.
|
|
|
|
|
|