Question

I'm wondering if anyone knows of a simple javascript graphing library that can plot, for example, the points (5,-2) and (6,1). I'd also like to be able to draw a line between these two points.

I've looked but so far cant find any [easy to use] library that can do this. I would appreciate any help or links to libraries.

Thanks!

Was it helpful?

Solution

Answering to your last comment, the way to create and plot some basic points with Flot is:

$(function () {
var d = [[0, 3], [4, 8], [7, 2]];
    $.plot($("#placeholder"), [ d ]);
});

Here you have the doc for more complex graphs http://people.iola.dk/olau/flot/API.txt and the web project page (google code)

http://code.google.com/p/flot/

Hope this could help you, if not in this site you can found a list of javascript plotting and charting libraries

http://javascript.open-libraries.com/utilities/chart/20-best-javascript-charting-and-plotting-libraries/

Edit If you want to plot a single point, the best way I've found is to use the options:

    var d = [[1,3]];
    var options = {
        series: {
          lines: { show: false },
          points: { show: true }
        }
    };
    $.plot($("#placeholder"), [ d ], options);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top