Giter VIP home page Giter VIP logo

Comments (6)

GoogleCodeExporter avatar GoogleCodeExporter commented on September 25, 2024
Hm, interesting. But I think it's a jQuery problem with how the document.ready 
event
works - if you add a console.log inside the function, it won't get called 
either. Try
this instead:

setTimeout(function() {
        var d1 = [];
        for (var i = 0; i < 14; i += 0.5)
            d1.push([i, Math.sin(i)]);

        var d2 = [[0, 3], [4, 8], [8, 5], [9, 13]];

        $.plot($("#placeholder"), [ d1, d2 ]);
},1000);

Hope this helps?

Original comment by olau%[email protected] on 7 Dec 2007 at 10:20

from flot.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 25, 2024
Hi, this has helped actually, thanks! Can you clarify what that line of code 
does? I
do not code with jQuery and am not familiar, maybe it'd be something useful to 
add to
your readme.

Thanks!

Original comment by [email protected] on 7 Dec 2007 at 12:03

from flot.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 25, 2024
Also, thanks. It's finally great to see a graph rendering within my software. I 
was
using plotr until it broke with the latest prototype and now the author of that
blogged flot so I thought I'd try it, the only downfall is that I now have to 
load
another large library.

Original comment by [email protected] on 7 Dec 2007 at 12:17

from flot.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 25, 2024
$(function () { ... }) is short-hand for $(document).ready(function () {...}). 
It's
documented here:

  http://docs.jquery.com/Events/ready#fn

Or in a more gentle manner in one of the tutorials here:

  http://docs.jquery.com/Tutorials

The short story: You normally wrap your Javascript inside the document.ready 
handler,
just about the opposite of what you've done :-), like this:

$(function () {
  setTimeout(function() {
        var d1 = [];
        for (var i = 0; i < 14; i += 0.5)
            d1.push([i, Math.sin(i)]);

        var d2 = [[0, 3], [4, 8], [8, 5], [9, 13]];

        $.plot($("#placeholder"), [ d1, d2 ]);
  },1000);
});

Original comment by [email protected] on 7 Dec 2007 at 12:49

from flot.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 25, 2024
Great, thanks. Again, perhaps add it to your readme. Other than that I  would 
say
this issue is closed.

Original comment by [email protected] on 7 Dec 2007 at 1:25

from flot.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 25, 2024
Sure.

Original comment by olau%[email protected] on 7 Dec 2007 at 3:28

  • Changed state: Fixed

from flot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.