reveal search box

PlotKit - Javascript Chart Plotting

Introduction

PlotKit is a Chart and Graph Plotting Library for Javascript. It has support for HTML Canvas and also SVG via Adobe SVG Viewer and native browser support.

PlotKit is fully documented and there is a quick tutorial to get you started.

PlotKit is a complete rewrite of CanvasGraph. It is better structured and supported.

Requirements

  • MochiKit 1.3 or higher
  • HTML Canvas: Safari 2+, Opera 9+, Firefox 1.5+, IE 6 (in emulated mode)
  • SVG: Opera 9+, Firefox 1.5+ (see note), IE6 with Adobe SVG.

Note: Firefox 1.5+ on Linux and Windows is supported. Firefox 1.5+ on Mac does not draw labels in SVG, so you must set axisLabelUseDiv to true if you want to have maximum compatibility.

License(s)

  • PlotKit is copyright (c) 2006 Alastair Tse. Licensed under the BSD License.
  • excanvas.js is copyright (c) 2006. Google Inc. Licensed under the Apache License.

Get/Download

Documentation

Development

Examples

Demo

Below is a demo of a simple HTML Canvas example which should work in Safari 2, Firefox 1.5, Internet Explorer 6 and Opera 9. And SVG Demo can also be found.

This is the HTML in the above demo:

<div class="demo" id="canvaspie" width="600" height="200"></div>
<div class="demo" id="canvasline" width="600" height="200"></div>
<div class="demo" id="canvasbar" width="600" height="200"></div>

And the Javascript that is needed to draw the charts:

function demo() {
   var hasCanvas = CanvasRenderer.isSupported();

   var opts = {
   "pieRadius": 0.4
   };

   var data1 = [[0, 5], [1, 4], [2, 3], [3, 5], [4, 6], [5, 7]];
   var data2 = [[0, 2.5], [1, 2], [2, 1.5], [3, 2.5], [4, 3], [5,
   3.5]];
   var data3 = [[0, 1.25], [1, 1], [2, 0.75], [3, 1.25], [4, 1.5], [5, 1.75]];

   if (hasCanvas) {
       var pie = new EasyPlot("pie", opts, $('canvaspie'), [data1]);
       var line = new EasyPlot("line", opts, $('canvasline'), [data1, data2, data3]);
       var bar = new EasyPlot("bar", opts, $('canvasbar'), [data1, data2, data3]);
   }
}

Screenshot

If you do not see the above, this is what you should have seen:

PlotKit Screenshot

About

PlotKit was created by: Alastair Tse - alastair@liquidx.net

add commentAdd a comment
Suchmaschinenoptimierung says
50
wow this is great tool, thank you very much. I just love it to use this with Google Analytics API, it's just simple to visualize the data
  • 1 day, 17 hours ago (12/03/2010)
Bed Bishop says
49
Nice work. Before today I used FusionCharts and OpenFlash but now I have a good possibility to test your software.
  • 1 month ago (05/02/2010)
wespai says
48
thx collect it to

ajax.wespai.com
  • 2 months, 2 weeks ago (28/12/2009)
Matt says
47
when I add window.onload = function;, the graphs fail to show
  • 5 months ago (09/10/2009)
Andreas says
46
Hi!
It is possible to use the library as it comes! xTickPrecision should limit such problems, however it happens too! All in all - a great and useful tool!
Thank you very much!
  • 5 months, 1 week ago (02/10/2009)
Villager says
45
Thanks, a great script
  • 5 months, 1 week ago (02/10/2009)
warpdesign says
44
Is having graph names supported in this version ?

Haven't had a look more closely yet, but using anything but numbers (ie: any string) as names for the charts doesn't seem to work (outputs "NaN" instead of the chosen string)

This doesn't change the fact that this plugin is real nice !
Good job !
  • 5 months, 2 weeks ago (30/09/2009)
babyschalen says
43
great work! thanks for this nice script!
  • 5 months, 2 weeks ago (27/09/2009)
Frank says
42
A very good script. Thanks !
  • 5 months, 2 weeks ago (27/09/2009)
Juscelino Barao says
41
How to add subtitles in the chart?
  • 5 months, 2 weeks ago (24/09/2009)
MB says
40
This is so awesome - THANK YOU! I spent hours trying to get nice looking graphs before I found this page
  • 5 months, 3 weeks ago (22/09/2009)
DSarathy says
39
Good work. Kudos to the team.
  • 5 months, 3 weeks ago (22/09/2009)
Templates says
38
great work done. Thank you very much for this awesome piece of code.
  • 6 months ago (09/09/2009)
Ferienwohnung Binz says
37
Great job - thanks a lot for sharing.
Best wishes from germany.
  • 6 months, 2 weeks ago (31/08/2009)
Muskelaufbau says
36
Thanks for this great library!!
Many greetings
  • 6 months, 3 weeks ago (25/08/2009)
Cloo Urne says
35
Fantastic - thanks for making these publicly available and for providing great documentation!
Many greetings
  • 6 months, 3 weeks ago (19/08/2009)
Mathieu says
34
Hi,

I am using the pie chart. I would like to display 2 decimals on the percentage. Is it possible ? How can i do it ? Because it seems that "PlotKit" doesn't display decimals...

Thanks,

Mat
  • 7 months ago (15/08/2009)
pfefferspray says
33
Thanks for this great library!!
  • 7 months ago (13/08/2009)
Mudasser Abbas says
32
Really its great script and great job ......
  • 7 months ago (13/08/2009)
webdesign stuttgart says
31
Nice work.. the first statistics i see which look good ;)
  • 7 months, 2 weeks ago (27/07/2009)
San says
30
Hi, Does anyone know how to name the x-axis and y-axis?
I have already checked out the xTicks's label option, but I am using that to indicate specific plot points, but would like to have something like x-axis: "Seconds" , and y-axis:"Mails"
  • 8 months, 2 weeks ago (30/06/2009)
horoscope says
29
Hi!
It is possible to use the library as it comes! xTickPrecision should limit such problems, however it happens too!
  • 8 months, 2 weeks ago (30/06/2009)
Balto says
28
Hi,
First, thanks for providing a useful tool to the public. I'm puzzled by the following:

I changed two lines in the quick start demo:
var layout = new PlotKit.Layout("line", {xTickPrecision:0});
layout.addDataset("sqrt", [[0.0698, 000], [1.01853563, 1000], [2.046628, 1414], [3.04762, 1730], [4.0, 2000]]);

yet when I display the plot (in Firefox) I see all the decimal precision in the x-values shown on the x-axis. I thought the purpose of "xTickPrecision" was to limit this. Is this a known issue or am I using the library incorrectly?
I appreciate your help.
Balto
  • 9 months, 1 week ago (09/06/2009)
namensschilder says
27
If any of you familiar with PlotKit have some extra time for some contract
work, please contact me at your earliest convenience. We need help
integrating PlotKit into our website.

Thank you,
  • 9 months, 3 weeks ago (26/05/2009)
sbihl says
26
Great library. Does anybody develop it further? Last update is dated in august of 2006.
  • 9 months, 4 weeks ago (18/05/2009)
medium says
25

extraordinary! I am amazed, I did not know that you can do graphics with JavaScript. thank you for sharing.
  • 10 months ago (17/05/2009)
Schauinsnetz says
24
is this the last version? i have a few problems to get this version work! Maybe i made something wrong?
  • 10 months, 2 weeks ago (01/05/2009)
rechtsberatung says
23
I was just looking for a tool like this, that would make our metrics look better. Thank you for this great libary!
  • 10 months, 2 weeks ago (28/04/2009)
Dida says
22
Wow, what a great library! I really enjoy it.
Didn't know, that you can do graphs with Javascript.
  • 10 months, 3 weeks ago (23/04/2009)
Smartphone says
21
Looks like a charm! Is is possible to use "live" tooltip?
  • 10 months, 3 weeks ago (23/04/2009)
Galadriel says
20
Hey, does the library support for dual Y axises?
  • 10 months, 3 weeks ago (23/04/2009)
j_butterfly says
19
真的很敬佩你!我今天才发现你做的Chart,还有这个网站,感觉真了不起,我也是个程序员,是友财网的作者(http://www.ucai8.com)不过真不能和你比,你真太厉害了,
  • 10 months, 3 weeks ago (23/04/2009)
j_butterfly says
18
Very cool!I find it just today ,hope go on update..
  • 10 months, 3 weeks ago (23/04/2009)
Jamorama says
17
Awesome charts mate, I like them because you can see right now what is happening.
  • 11 months ago (18/04/2009)
Hochzeit Garmisch says
16
Wow!!! That's great stuff! I've never seen this before. Thanx
  • 11 months ago (16/04/2009)
urlaub says
15
thanks for your commitment
  • 11 months ago (13/04/2009)
Webdesign says
14
Wow, this is cool. I'm a web developer myself but I didn't know that Javascript can be used to draw pie charts!!
  • 1 year ago (22/02/2009)
jQuery Tutorials says
13
There is also another plotting script written in jQuery called <a href="http://code.google.com/p/flot/">flot</a>. But I like the design of PlotKit more...

I really hope the new version/update will be out soon and thanks for this awesom script Alastair Tse...
  • 1 year, 1 month ago (11/02/2009)
me says
12
好!
  • 1 year, 1 month ago (09/02/2009)
Olivier says
11
I found this code really neat and great, thanks really to the guy who gave his time to write it.

I have a quick question: can the data displayed on y-axis start to a different value from zero?
For instance, let's say the samples would be [100.24, 100.34, 100.45, 100.12], I think the y-axis start value is always zero, unless I am missing something.

Is there a way to change this?
  • 1 year, 3 months ago (08/12/2008)
Joe says
10
When will the new build come out - i.e. compatible with IE without any tweaking?
  • 1 year, 4 months ago (06/11/2008)
tanzmusik says
9
Thats such a great Plugin. Thanks for coding this
  • 1 year, 4 months ago (25/10/2008)
Z242000 says
8
Anyone else have some decent docs on how to implement a legend with this?
  • 1 year, 6 months ago (18/08/2008)
neva says
7
Great library! I just started using it and so far really enjoy it.
  • 1 year, 8 months ago (12/07/2008)
Alex says
6
Is there any code difference between the kit downloaded and the one on your site?
  • 1 year, 8 months ago (12/07/2008)
Web Design Glasgow says
5
Fantastic - thanks for making these publicly available and for providing great documentation!
  • 1 year, 11 months ago (10/04/2008)
mike says
4
The examples are the kind of very low quality plots I would expect from limited utility spreadsheet programs such as excel.
Can it draw detailed plots too?
  • 1 year, 11 months ago (28/03/2008)
kenoko says
3
Very nice stuff
  • 2 years ago (23/02/2008)
Max says
2
I created a www.web2py.com helper to use PlotKit. You can find it in the PlotKit appliance at http://mdp.cti.depaul.edu/appliances
  • 2 years, 1 month ago (29/01/2008)
January Autumn says
1
I've downloaded. But the demo can't run. Pls help me.
  • 2 years, 1 month ago (21/01/2008)