4 | Radar Chart
5 |
6 |
7 |
11 |
12 |
13 |
14 |
15 |
16 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/samples/doughnut.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Doughnut Chart
5 |
6 |
7 |
11 |
12 |
13 |
14 |
15 |
16 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/samples/bar.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Bar Chart
5 |
6 |
7 |
11 |
12 |
13 |
14 |
15 |
16 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/samples/polarArea.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Polar Area Chart
5 |
6 |
7 |
9 |
10 |
11 |
12 |
13 |
14 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | Copyright (c) 2013 Nick Downie
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4 |
5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6 |
7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8 |
--------------------------------------------------------------------------------
/samples/line.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Line Chart
5 |
6 |
7 |
11 |
12 |
13 |
14 |
15 |
16 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/samples/radar.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Radar Chart
5 |
6 |
7 |
11 |
12 |
13 |
14 |
15 |
16 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/docs/prettify.less:
--------------------------------------------------------------------------------
1 | /* Pretty printing styles. Used with prettify.js. */
2 | /* Vim sunburst theme by David Leibovic */
3 |
4 | pre .str{ color: #65B042; } /* string - green */
5 | pre .kwd{ color: #E28964; } /* keyword - dark pink */
6 | pre .com{ color: #AEAEAE; font-style: italic; } /* comment - gray */
7 | pre .typ{ color: #89bdff; } /* type - light blue */
8 | pre .lit{ color: #3387CC; } /* literal - blue */
9 | pre .pun{ color: #fff; } /* punctuation - white */
10 | pre .pln{ color: #fff; } /* plaintext - white */
11 | pre .tag{ color: #89bdff; } /* html/xml tag - light blue */
12 | pre .atn{ color: #bdb76b; } /* html/xml attribute name - khaki */
13 | pre .atv{ color: #65B042; } /* html/xml attribute value - green */
14 | pre .dec{ color: #3387CC; } /* decimal - blue */
15 |
16 | /* Specify class=linenums on a pre to get line numbering */
17 | ol.linenums { margin-top: 0; margin-bottom: 0; color: #AEAEAE; } /* IE indents via margin-left */
18 | li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8 { list-style-type: none }
19 | /* Alternate shading for lines */
20 | li.L1,li.L3,li.L5,li.L7,li.L9 { }
21 |
22 | @media print {
23 | pre .str{ color: #060; }
24 | pre .kwd{ color: #006; font-weight: bold; }
25 | pre .com{ color: #600; font-style: italic; }
26 | pre .typ{ color: #404; font-weight: bold; }
27 | pre .lit{ color: #044; }
28 | pre .pun{ color: #440; }
29 | pre .pln{ color: #000; }
30 | pre .tag{ color: #006; font-weight: bold; }
31 | pre .atn{ color: #404; }
32 | pre .atv{ color: #060; }
33 | }
--------------------------------------------------------------------------------
/docs/prettify.css:
--------------------------------------------------------------------------------
1 | /* Pretty printing styles. Used with prettify.js. */
2 | /* Vim sunburst theme by David Leibovic */
3 |
4 | pre .str, code .str { color: #65B042; } /* string - green */
5 | pre .kwd, code .kwd { color: #E28964; } /* keyword - dark pink */
6 | pre .com, code .com { color: #AEAEAE; font-style: italic; } /* comment - gray */
7 | pre .typ, code .typ { color: #89bdff; } /* type - light blue */
8 | pre .lit, code .lit { color: #3387CC; } /* literal - blue */
9 | pre .pun, code .pun { color: #fff; } /* punctuation - white */
10 | pre .pln, code .pln { color: #fff; } /* plaintext - white */
11 | pre .tag, code .tag { color: #89bdff; } /* html/xml tag - light blue */
12 | pre .atn, code .atn { color: #bdb76b; } /* html/xml attribute name - khaki */
13 | pre .atv, code .atv { color: #65B042; } /* html/xml attribute value - green */
14 | pre .dec, code .dec { color: #3387CC; } /* decimal - blue */
15 |
16 | pre.prettyprint, code.prettyprint {
17 | background-color: #000;
18 | -moz-border-radius: 8px;
19 | -webkit-border-radius: 8px;
20 | -o-border-radius: 8px;
21 | -ms-border-radius: 8px;
22 | -khtml-border-radius: 8px;
23 | border-radius: 8px;
24 | }
25 |
26 | pre.prettyprint {
27 | width: 95%;
28 | margin: 1em auto;
29 | padding: 1em;
30 | white-space: pre-wrap;
31 | }
32 |
33 |
34 | /* Specify class=linenums on a pre to get line numbering */
35 | ol.linenums { margin-top: 0; margin-bottom: 0; color: #AEAEAE; } /* IE indents via margin-left */
36 | li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8 { list-style-type: none }
37 | /* Alternate shading for lines */
38 | li.L1,li.L3,li.L5,li.L7,li.L9 { }
39 |
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | Chart.js
2 | =======
3 | *Simple HTML5 Charts using the canvas element* [chartjs.org](http://www.chartjs.org)
4 |
5 | Quick FYI
6 | -------
7 | I'm currently working on a big refactor of the library into a more object oriented structure.
8 |
9 | It'll have an extendable class structure for adding community developed chart types. By opening up components into Chart.js into extendable classes, it'll allow for much easier community driven library extensions rather than tacking on new features as required. The refactor will also feature a generisized version of the interaction layer introduced by Regaddi in his tooltips branch - https://github.com/nnnick/Chart.js/pull/51. On top of this, it'll include utility methods on each chart object, for updating, clearing and redrawing charts etc.
10 |
11 | I haven't quite got the bandwidth right now to be juggling both issues/requests in master while redesigning all of the core code in Chart.js. By focusing on the refactor, it'll get done WAY quicker.
12 |
13 | Extensibility will absolutely be at the core of the refactor, allowing for the development of complex extension modules, but also keeping a lightweight set of core code.
14 |
15 | Hang tight - it'll be worth it.
16 |
17 | PS. If you're interested in reviewing some code or trying out writing extensions, shoot me an email.
18 |
19 | ###Update - 8th September
20 | Just a quick update on the refactor.
21 |
22 | Just wanted to let you guys know it's making really good progress, and it'll be well worth the wait.
23 |
24 | The new version is being broken up into Chart type modules, with each of the current 6 chart types using documented and extendable classes and helper methods from the Chart.js core. This means the community will be able to build new chart types using existing components, or extend existing types to do something a bit different.
25 |
26 | By splitting the different charts into modules will mean the ability to use AMD if appropriate, but I'll also be writing a simple web interface for concatenating chart types into a minified production ready custom build.
27 |
28 | The syntax for creating charts **will not change**, so the upgrade should be a drop in replacement, but give you the ability to have a whole new level of interactivity and animated data updates.
29 |
30 | Right now I've wrote 80% of the core, and refactored the Doughnut and Pie charts, and I'm a good way through the Line and Bar charts. I hope to have the new version ready to release with some new docs late September/early October.
31 |
32 | I know PR and issues are racking up in the repo, and I'll do my best to sort them ASAP, but I think this update is really important for creating flexibility and extensibility to cater for these new features in an elegant way, rather than introducing scope creep into an architecture that wasn't designed to deliver this extra functionality.
33 |
34 | Big thanks for all the support - it's been totally overwhelming.
35 |
36 | ###Another Quick Update - 16th October
37 | First of all - my apologies, early October has drifted away from me and we're moving towards late October. This last month has been really unexpectedly busy, and I've had a lot of stuff going on, so I haven't quite managed to find as much time to work on Chart.js as I'd hoped.
38 |
39 | In terms of an updated ETA, I'm really aiming for a pre-November release, and I'll be having some late nights and a few days off to try my best to make this happen.
40 |
41 | Again, really appreciate the support and cheers for your patience for the new version.
42 |
43 |
44 | Documentation
45 | -------
46 | You can find documentation at [chartjs.org/docs](http://www.chartjs.org/docs).
47 |
48 | License
49 | -------
50 | Chart.js was taken down on the 19th March. It is now back online for good and IS available under MIT license.
51 |
52 | Chart.js is available under the [MIT license] (http://opensource.org/licenses/MIT).
53 |
--------------------------------------------------------------------------------
/docs/styles.less:
--------------------------------------------------------------------------------
1 | @import "prettify";
2 |
3 | @codeBackground : #292B36;
4 |
5 | @primaryFont : "proxima-nova";
6 |
7 | @textColour : #282B36;
8 | @secondaryTextColour : #767c8d;
9 |
10 | @borderPaleColour : #EBEBEB;
11 | @pageBorderColour : @textColour;
12 |
13 | @red : #F33E6F;
14 | @green : #46BFBD;
15 | @yellow : #FDB45C;
16 | @blue : #2D91EA;
17 |
18 | *{
19 | padding:0;
20 | margin:0;
21 | box-sizing:border-box;
22 | -moz-box-sizing:border-box;
23 | -webkit-box-sizing:border-box;
24 | color:inherit;
25 | text-rendering: optimizeLegibility;
26 | }
27 |
28 | body{
29 | color: @textColour;
30 | min-width: 768px;
31 | }
32 |
33 | .redBorder,.greenBorder,.yellowBorder{
34 | border-top: 8px solid @pageBorderColour;
35 | width: 33.33%;
36 | float: left;
37 | height: 16px;
38 | position: relative;
39 | z-index:50;
40 | }
41 | .redBorder{
42 | background-color: @red;
43 | }
44 | .greenBorder{
45 | background-color: @green;
46 | }
47 | .yellowBorder{
48 | background-color: @yellow;
49 | }
50 |
51 | h1{
52 | font-family: @primaryFont;
53 | font-weight: 600;
54 | font-size: 32px;
55 | }
56 | h2{
57 | font-family: @primaryFont;
58 | font-weight: 600;
59 | font-size: 22px;
60 | line-height: 40px;
61 | }
62 | #mainHeader{
63 | font-size: 55px;
64 | }
65 | #introText{
66 | font-weight: 400;
67 | margin-top: 20px;
68 | font-size: 26px;
69 | line-height: 40px;
70 | margin-bottom: 40px;
71 | }
72 | #wrapper{
73 | margin: 0 auto;
74 | position: relative;
75 | min-width: 768px;
76 | nav{
77 | width: 20%;
78 | padding-right: 20px;
79 | position: fixed;
80 | height: 100%;
81 | overflow-y: scroll;
82 | top: 0;
83 | z-index: 0;
84 | padding: 40px 20px;
85 | font-family: @primaryFont;
86 | background-color: @borderPaleColour;
87 |
88 | dl{
89 | color: @secondaryTextColour;
90 | dt{
91 | list-style: none;
92 | margin-top: 10px;
93 | margin-bottom: 5px;
94 | a{
95 | display: block;
96 | padding: 2px 0;
97 | border-bottom: 1px solid fade(@secondaryTextColour,20%);
98 | text-decoration: none;
99 | }
100 | }
101 | dd{
102 | margin-bottom: 5px;
103 | padding-left: 5px;
104 | &:before{
105 | content: "- ";
106 |
107 | }
108 | a{
109 | text-decoration:none;
110 | font-size: 12px;
111 | border-bottom: 1px solid transparent;
112 | }
113 | }
114 | a{
115 | -webkit-transition: all 200ms ease-in-out;
116 | -moz-transition: all 200ms ease-in-out;
117 | -o-transition: all 200ms ease-in-out;
118 | -ms-transition: all 200ms ease-in-out;
119 | transition: all 200ms ease-in-out;
120 | &:hover{
121 | color: @blue;
122 | border-bottom-color:@blue;
123 | }
124 | }
125 |
126 | }
127 | }
128 | #contentWrapper{
129 | width: 80%;
130 | max-width: 1080px;
131 | margin-left: 20%;
132 | padding: 0px 40px;
133 | padding-top: 72px;
134 | }
135 | }
136 | article{
137 | border-top: 1px solid @borderPaleColour;
138 | padding: 40px 0;
139 | h2{
140 | margin-top: 20px;
141 | }
142 | }
143 |
144 | p,ul li{
145 | font-family: @primaryFont;
146 | line-height: 20px;
147 | font-size: 16px;
148 | margin-top: 10px;
149 | color: @secondaryTextColour;
150 | a{
151 | text-decoration: none;
152 | border-bottom: 1px solid @blue;
153 | color: @blue;
154 | }
155 | }
156 |
157 | canvas{
158 | margin-top: 20px;
159 | }
160 | pre{
161 | background-color: @codeBackground;
162 | padding: 10px;
163 | border-radius: 5px;
164 | position: relative;
165 | -webkit-font-smoothing: antialiased;
166 | margin: 40px 0 20px 0;
167 | code{
168 | display: block;
169 | }
170 | &:before{
171 | content: attr(data-type);
172 | position: absolute;
173 | font-size: 12px;
174 | top: -30px;
175 | left: 0;
176 | font-family: @primaryFont;
177 | font-weight: 400;
178 | display: inline-block;
179 | padding: 2px 5px;
180 | border-radius: 5px;
181 | background-color: @borderPaleColour;
182 | }
183 | }
184 | p{
185 | }
--------------------------------------------------------------------------------
/samples/sixup.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Doughnut Chart
5 |
6 |
7 |
12 |
13 |
14 |