开发者

Simple opensource javascript library for creating (stacked) line graph?

I need a lightweight javascript library to create a stacked line graph (a bit like what is used in financial graphs).开发者_StackOverflow The X axis will be dates and the Y axis will be ordinary float values.

There will be two sections of the graph:

  1. Top graph which is a line graph. I want to be able to specify the color of a line segment (i.e. joining two dated points)

  2. The bottom part is just a rectangle/bar which represents the value. Once again, I want to be able to specify the color of the bar for a particular date.

It would be cool if the library used JQuery (since I have used jQuery in the past) - but even plain old JS code library would be equally useful.


I recommend Google Chart API / Chart Tools (examples) and Google Visualization API (examples).

The former being less powerful than the latter, but also more low-tech, so possibly easier to use (and more portable across platforms. The basic Chart API generates static images for you).

But you can also use:

  • gRaphael
  • Bluff
  • PlotKit
  • CanvasGraphJS
  • Grafico
  • RGraph
  • Plotr

Or even use a more high-level library like ExtJS (examples).


look at JQPlot http://www.jqplot.com/


UPDATE: Here is a recent and very impressive chart library built by Baidu folks:
http://ecomfe.github.io/echarts/index-en.html
And this one is open source.


Another free option are the Google visualisations.

They could be an overkill for your needs. But you can provide to the users different kind of graphics as they all share the same dataset structure.

The good, you don't host them, they are on the Google's infrastructure and save you the bandwith. The bad, you don't host them... It is not opensource, you can't hack them if you want.

We use them in our web app and are quite happy from it.
Except they don't work with Android, as many use SVG/VML that is off by default for now.


Use raphaeljs and the complimentary charting library. The charting library link has a few examples that will show you what you can do - just view source them to see how easy it is.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜