From 2d6aa6e987c9b704a4a266f6b84788fc5abd5b8c Mon Sep 17 00:00:00 2001 From: "olau@iola.dk" Date: Fri, 14 Mar 2008 10:48:35 +0000 Subject: [PATCH] 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 --- README.txt | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/README.txt b/README.txt index f03d75a..83d9a81 100644 --- a/README.txt +++ b/README.txt @@ -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 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:
-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.