Reputation: 156
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!
Upvotes: 1
Views: 1727
Reputation: 934
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)
Hope this could help you, if not in this site you can found a list of javascript plotting and charting 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);
Upvotes: 1