FAQ.txt 3.2 KB

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