问题描述
我不知道是否有任何2D图形绘制上使用JavaScript客户端运行库?其基本思想是,你可以把一个情节在浏览器中,用户可以改变的事情像X和Y的规模和范围,放大和缩小,而无需不断从服务器重新加载网页。数据本身将通过AJAX来获取,这将允许用户也只需的wget
直起,如果他们想使用重型工具服务器的数据。类似的 matplotlib
的2D部分为Python。
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.
这是我以前决定,这是更快的发展,仅仅产生在服务器端的SVG一些code(使用内置eCos的Web服务器)之前,拿出来一看很长一段时间,但现在我一直在阅读上像Prototype和jQuery的,我不知道是否有人已经走了,这样做了。
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.
推荐答案
您可能感兴趣的尝试的。海军报是一个纯粹的Javascript开源绘制的的jQuery 库。它产生于即时在客户端的任意数据集的图形曲线
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.
首先,请务必检查下面的例子,它使用的数据通过AJAX获取绘制图表的REA-LTIME:
First of all, make sure to check the following example which uses data fetched via AJAX to plot a chart in rea-ltime:
这是如何取得和绘图与AJAX中的数据会看起来像code:
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
这篇关于开源客户端的JavaScript为基础的2D数据绘制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!