| @@ -1,76 +1,76 @@ | ||
| 1 | -Frequently asked questions | |
| 2 | - | |
| 3 | -Q: How much data can Flot cope with? | |
| 4 | - | |
| 5 | -A: Flot will happily draw everything you send to it so the answer | |
| 6 | -depends on the browser. The excanvas emulation used for IE (built with | |
| 7 | -VML) makes IE by far the slowest browser so be sure to test with that | |
| 8 | -if IE users are in your target group. | |
| 9 | - | |
| 10 | -1000 points is not a problem, but as soon as you start having more | |
| 11 | -points than the pixel width, you should probably start thinking about | |
| 12 | -downsampling/aggregation as this is near the resolution limit of the | |
| 13 | -chart anyway. If you downsample server-side, you also save bandwidth. | |
| 14 | - | |
| 15 | - | |
| 16 | -Q: Flot isn't working when I'm using JSON data as source! | |
| 17 | - | |
| 18 | -A: Actually, Flot loves JSON data, you just got the format wrong. | |
| 19 | -Double check that you're not inputting strings instead of numbers, | |
| 20 | -like [["0", "-2.13"], ["5", "4.3"]]. This is most common mistake, and | |
| 21 | -the error might not show up immediately because Javascript can do some | |
| 22 | -conversion automatically. | |
| 23 | - | |
| 24 | - | |
| 25 | -Q: Can I export the graph? | |
| 26 | - | |
| 27 | -A: This is a limitation of the canvas technology. There's a hook in | |
| 28 | -the canvas object for getting an image out, but you won't get the tick | |
| 29 | -labels. And it's not likely to be supported by IE. At this point, your | |
| 30 | -best bet is probably taking a screenshot, e.g. with PrtScn. | |
| 31 | - | |
| 32 | - | |
| 33 | -Q: The bars are all tiny in time mode? | |
| 34 | - | |
| 35 | -A: It's not really possible to determine the bar width automatically. | |
| 36 | -So you have to set the width with the barWidth option which is NOT in | |
| 37 | -pixels, but in the units of the x axis (or the y axis for horizontal | |
| 38 | -bars). For time mode that's milliseconds so the default value of 1 | |
| 39 | -makes the bars 1 millisecond wide. | |
| 40 | - | |
| 41 | - | |
| 42 | -Q: Can I use Flot with libraries like Mootools or Prototype? | |
| 43 | - | |
| 44 | -A: Yes, Flot supports it out of the box and it's easy! Just use jQuery | |
| 45 | -instead of $, e.g. call jQuery.plot instead of $.plot and use | |
| 46 | -jQuery(something) instead of $(something). As a convenience, you can | |
| 47 | -put in a DOM element for the graph placeholder where the examples and | |
| 48 | -the API documentation are using jQuery objects. | |
| 49 | - | |
| 50 | -Depending on how you include jQuery, you may have to add one line of | |
| 51 | -code to prevent jQuery from overwriting functions from the other | |
| 52 | -libraries, see the documentation in jQuery ("Using jQuery with other | |
| 53 | -libraries") for details. | |
| 54 | - | |
| 55 | - | |
| 56 | -Q: Flot doesn't work with [insert name of Javascript UI framework]! | |
| 57 | - | |
| 58 | -A: The only non-standard thing used by Flot is the canvas tag; | |
| 59 | -otherwise it is simply a series of absolute positioned divs within the | |
| 60 | -placeholder tag you put in. If this is not working, it's probably | |
| 61 | -because the framework you're using is doing something weird with the | |
| 62 | -DOM, or you're using it the wrong way. | |
| 63 | - | |
| 64 | -A common problem is that there's display:none on a container until the | |
| 65 | -user does something. Many tab widgets work this way, and there's | |
| 66 | -nothing wrong with it - you just can't call Flot inside a display:none | |
| 67 | -container as explained in the README so you need to hold off the Flot | |
| 68 | -call until the container is actually displayed (or use | |
| 69 | -visibility:hidden instead of display:none or move the container | |
| 70 | -off-screen). | |
| 71 | - | |
| 72 | -If you find there's a specific thing we can do to Flot to help, feel | |
| 73 | -free to submit a bug report. Otherwise, you're welcome to ask for help | |
| 74 | -on the forum/mailing list, but please don't submit a bug report to | |
| 75 | -Flot. | |
| 1 | +Frequently asked questions | |
| 2 | +-------------------------- | |
| 3 | + | |
| 4 | +Q: How much data can Flot cope with? | |
| 5 | + | |
| 6 | +A: Flot will happily draw everything you send to it so the answer | |
| 7 | +depends on the browser. The excanvas emulation used for IE (built with | |
| 8 | +VML) makes IE by far the slowest browser so be sure to test with that | |
| 9 | +if IE users are in your target group. | |
| 10 | + | |
| 11 | +1000 points is not a problem, but as soon as you start having more | |
| 12 | +points than the pixel width, you should probably start thinking about | |
| 13 | +downsampling/aggregation as this is near the resolution limit of the | |
| 14 | +chart anyway. If you downsample server-side, you also save bandwidth. | |
| 15 | + | |
| 16 | + | |
| 17 | +Q: Flot isn't working when I'm using JSON data as source! | |
| 18 | + | |
| 19 | +A: Actually, Flot loves JSON data, you just got the format wrong. | |
| 20 | +Double check that you're not inputting strings instead of numbers, | |
| 21 | +like [["0", "-2.13"], ["5", "4.3"]]. This is most common mistake, and | |
| 22 | +the error might not show up immediately because Javascript can do some | |
| 23 | +conversion automatically. | |
| 24 | + | |
| 25 | + | |
| 26 | +Q: Can I export the graph? | |
| 27 | + | |
| 28 | +A: This is a limitation of the canvas technology. There's a hook in | |
| 29 | +the canvas object for getting an image out, but you won't get the tick | |
| 30 | +labels. And it's not likely to be supported by IE. At this point, your | |
| 31 | +best bet is probably taking a screenshot, e.g. with PrtScn. | |
| 32 | + | |
| 33 | + | |
| 34 | +Q: The bars are all tiny in time mode? | |
| 35 | + | |
| 36 | +A: It's not really possible to determine the bar width automatically. | |
| 37 | +So you have to set the width with the barWidth option which is NOT in | |
| 38 | +pixels, but in the units of the x axis (or the y axis for horizontal | |
| 39 | +bars). For time mode that's milliseconds so the default value of 1 | |
| 40 | +makes the bars 1 millisecond wide. | |
| 41 | + | |
| 42 | + | |
| 43 | +Q: Can I use Flot with libraries like Mootools or Prototype? | |
| 44 | + | |
| 45 | +A: Yes, Flot supports it out of the box and it's easy! Just use jQuery | |
| 46 | +instead of $, e.g. call jQuery.plot instead of $.plot and use | |
| 47 | +jQuery(something) instead of $(something). As a convenience, you can | |
| 48 | +put in a DOM element for the graph placeholder where the examples and | |
| 49 | +the API documentation are using jQuery objects. | |
| 50 | + | |
| 51 | +Depending on how you include jQuery, you may have to add one line of | |
| 52 | +code to prevent jQuery from overwriting functions from the other | |
| 53 | +libraries, see the documentation in jQuery ("Using jQuery with other | |
| 54 | +libraries") for details. | |
| 55 | + | |
| 56 | + | |
| 57 | +Q: Flot doesn't work with [insert name of Javascript UI framework]! | |
| 58 | + | |
| 59 | +A: The only non-standard thing used by Flot is the canvas tag; | |
| 60 | +otherwise it is simply a series of absolute positioned divs within the | |
| 61 | +placeholder tag you put in. If this is not working, it's probably | |
| 62 | +because the framework you're using is doing something weird with the | |
| 63 | +DOM, or you're using it the wrong way. | |
| 64 | + | |
| 65 | +A common problem is that there's display:none on a container until the | |
| 66 | +user does something. Many tab widgets work this way, and there's | |
| 67 | +nothing wrong with it - you just can't call Flot inside a display:none | |
| 68 | +container as explained in the README so you need to hold off the Flot | |
| 69 | +call until the container is actually displayed (or use | |
| 70 | +visibility:hidden instead of display:none or move the container | |
| 71 | +off-screen). | |
| 72 | + | |
| 73 | +If you find there's a specific thing we can do to Flot to help, feel | |
| 74 | +free to submit a bug report. Otherwise, you're welcome to ask for help | |
| 75 | +on the forum/mailing list, but please don't submit a bug report to | |
| 76 | +Flot. | |