admin管理员组文章数量:1353265
I'm wondering if there are any 2D graph plotting libraries that run on the client side using JavaScript? The basic idea is that you could put up a plot in a browser and the user can change things like X and Y scales and limits, zooming in and out, without having to constantly reload the web page from the server. The data itself would be fetched via AJAX, which would allow a user to also just wget
the data straight from the server if they want to use heavy-duty tools. Something like the 2D part of matplotlib
for Python.
This is something I took a look at a long time ago before deciding that it was faster to develop some code that just generated an SVG on the server side (using a built-in eCos web server), but now that I've been reading up on things like Prototype and jQuery, I'm wondering if someone has gone and done this already.
I'm wondering if there are any 2D graph plotting libraries that run on the client side using JavaScript? The basic idea is that you could put up a plot in a browser and the user can change things like X and Y scales and limits, zooming in and out, without having to constantly reload the web page from the server. The data itself would be fetched via AJAX, which would allow a user to also just wget
the data straight from the server if they want to use heavy-duty tools. Something like the 2D part of matplotlib
for Python.
This is something I took a look at a long time ago before deciding that it was faster to develop some code that just generated an SVG on the server side (using a built-in eCos web server), but now that I've been reading up on things like Prototype and jQuery, I'm wondering if someone has gone and done this already.
Share Improve this question asked Jan 21, 2010 at 16:40 Mike DeSimoneMike DeSimone 42.9k10 gold badges77 silver badges97 bronze badges3 Answers
Reset to default 5http://g.raphaeljs./ - cross browser patible JS charting library.
You may be interested in trying Flot. Flot is a pure Javascript open-source plotting library for jQuery. It produces graphical plots of arbitrary datasets on-the-fly on the client-side.
First of all, make sure to check the following example which uses data fetched via AJAX to plot a chart in rea-ltime:
- Flot Examples - Updating graphs with AJAX
This is how fetching and plotting the data with AJAX would look like in code:
function fetchData() {
function onDataReceived(series) {
data = [ series ];
$.plot($("#placeholder"), data, options);
}
$.ajax({
url: "data_feed.php",
method: "GET",
dataType: "json",
success: onDataReceived
});
setTimeout(fetchData, 1000);
}
Stack Overflow also uses Flot for the zoomable chart in the Reputation tab of user profiles.
For further information on Flot:
- Flot Project Site
- Flot Examples
- Other Flot Examples
This web page pares different javascript plotting tools.
http://sixrevisions./javascript/graph_chart_plot_data_javascript/
FLOT: http://code.google./p/flot/
本文标签: ajaxOpensource clientside JavaScriptbased 2D data plottingStack Overflow
版权声明:本文标题:ajax - Open-source client-side JavaScript-based 2D data plotting? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743927669a2563264.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论