Trouble getting started: "Uncaught TypeError: Cannot read property 'plugins' of undefined"

2,356 views
Skip to first unread message

Andrew Schwartz

unread,
May 5, 2015, 11:23:50 AM5/5/15
to flot-...@googlegroups.com
Occurs simply by including the flot code in my project. Error occurs, among many other places, at jquery.flot.canvas.js?body=1:339

In the console:
$.plot
> undefined

So, of course, when I try the "getting started" code, which includes a call to $.plot(...), I get

Uncaught TypeError: $.plot is not a function

Am I missing something? Is there more I need to install? It seems like I have the flot and jquery code, but why can't I use $.plot()?



Stephen Hartzell

unread,
May 6, 2015, 12:03:26 PM5/6/15
to flot-...@googlegroups.com
I suspect that you are including your plugins before jquery.flot.js. jquery.flot.js has to be included before any of the plugins. So for example, your index.html should like like:

<script src="lib/jquery.flot.js"></script>
<script src="lib/jquery.flot.canvas.js"></script>
...
Reply all
Reply to author
Forward
0 new messages