Subversion Repositories Integrator Subversion

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 espaco 1
# Morris.js - pretty time-series line graphs
2
 
3
[![Build Status](https://secure.travis-ci.org/morrisjs/morris.js.png?branch=master)](http://travis-ci.org/morrisjs/morris.js)
4
 
5
Morris.js is the library that powers the graphs on http://howmanyleft.co.uk/.
6
It's a very simple API for drawing line, bar, area and donut charts.
7
 
8
Cheers!
9
 
10
\- Olly (olly@oesmith.co.uk)
11
 
12
## Contributors wanted
13
 
14
I'm unfortunately not able to actively support Morris.js any more. I keep an eye
15
on the issues, but I rarely have the time to fix bugs or review pull requests.
16
 
17
If you're interested in actively contributing to Morris.js, please contact me on
18
the email address above.
19
 
20
## Requirements
21
 
22
- [jQuery](http://jquery.com/) (>= 1.7 recommended, but it'll probably work with
23
  older versions)
24
- [Raphael.js](http://raphaeljs.com/) (>= 2.0)
25
 
26
## Usage
27
 
28
See [the website](http://morrisjs.github.com/morris.js/).
29
 
30
## Development
31
 
32
Very daring.
33
 
34
Fork, hack, possibly even add some tests, then send a pull request :)
35
 
36
Remember that Morris.js is a coffeescript project. Please make your changes in
37
the `.coffee` files, not in the compiled javascript files in the root directory
38
of the project.
39
 
40
### Developer quick-start
41
 
42
You'll need [node.js](https://nodejs.org).  I recommend using
43
[nvm](https://github.com/creationix/nvm) for installing node in
44
development environments.
45
 
46
With node installed, install [grunt](https://github.com/cowboy/grunt) using
47
`npm install -g grunt-cli`, and then the rest of the test/build dependencies
48
with `npm install` in the morris.js project folder.
49
 
50
Once you're all set up, you can compile, minify and run the tests using `grunt`.
51
 
52
Note: I'm experimenting with using perceptual diffs to catch rendering
53
regressions. Due to font rendering differences between platforms, the pdiff
54
tests currently *only* pass on OS X.
55
 
56
## Changelog
57
 
58
### 0.5.1 - 15th June 2014
59
 
60
- Fix touch event handling.
61
- Fix stacked=false in bar chart [#275](https://github.com/morrisjs/morris.js/issues/275)
62
- Configurable vertical segments [#297](https://github.com/morrisjs/morris.js/issues/297)
63
- Deprecate continuousLine option.
64
 
65
### 0.5.0 - 19th March 2014
66
 
67
- Update grunt dependency [#288](https://github.com/morrisjs/morris.js/issues/228)
68
- Donut segment color config in data objects [#281](https://github.com/morrisjs/morris.js/issues/281)
69
- Customisable line widths and point drawing [#272](https://github.com/morrisjs/morris.js/issues/272)
70
- Bugfix for @options.smooth [#266](https://github.com/morrisjs/morris.js/issues/266)
71
- Option to disable axes individually [#253](https://github.com/morrisjs/morris.js/issues/253)
72
- Range selection [#252](https://github.com/morrisjs/morris.js/issues/252)
73
- Week format for x-labels [#250](https://github.com/morrisjs/morris.js/issues/250)
74
- Update developer quickstart instructions [#243](https://github.com/morrisjs/morris.js/issues/243)
75
- Experimenting with perceptual diffs.
76
- Add original data row to hover callback [#264](https://github.com/morrisjs/morris.js/issues/264)
77
- setData method for donut charts [#211](https://github.com/morrisjs/morris.js/issues/211)
78
- Automatic resizing [#111](https://github.com/morrisjs/morris.js/issues/111)
79
- Fix travis builds [#298](https://github.com/morrisjs/morris.js/issues/298)
80
- Option for rounded corners on bar charts [#305](https://github.com/morrisjs/morris.js/issues/305)
81
- Option to set padding for X axis labels [#306](https://github.com/morrisjs/morris.js/issues/306)
82
- Use local javascript for examples.
83
- Events on non-time series [#314](https://github.com/morrisjs/morris.js/issues/314)
84
 
85
### 0.4.3 - 12th May 2013
86
 
87
- Fix flickering hover box [#186](https://github.com/morrisjs/morris.js/issues/186)
88
- xLabelAngle option (diagonal labels!!) [#239](https://github.com/morrisjs/morris.js/issues/239)
89
- Fix area chart fill bug [#190](https://github.com/morrisjs/morris.js/issues/190)
90
- Make event handlers chainable
91
- gridTextFamily and gridTextWeight options
92
- Fix hovers with setData [#213](https://github.com/morrisjs/morris.js/issues/213)
93
- Fix hideHover behaviour [#236](https://github.com/morrisjs/morris.js/issues/236)
94
 
95
### 0.4.2 - 14th April 2013
96
 
97
- Fix DST handling [#191](https://github.com/morrisjs/morris.js/issues/191)
98
- Parse data values from strings in Morris.Donut [#189](https://github.com/morrisjs/morris.js/issues/189)
99
- Non-cumulative area charts [#199](https://github.com/morrisjs/morris.js/issues/199)
100
- Round Y-axis labels to significant numbers [#162](https://github.com/morrisjs/morris.js/162)
101
- Customising default hover content [#179](https://github.com/morrisjs/morris.js/179)
102
 
103
### 0.4.1 - 8th February 2013
104
 
105
- Fix goal and event rendering. [#181](https://github.com/morrisjs/morris.js/issues/181)
106
- Don't break when empty data is passed to setData [#142](https://github.com/morrisjs/morris.js/issues/142)
107
- labelColor option for donuts [#159](https://github.com/morrisjs/morris.js/issues/159)
108
 
109
### 0.4.0 - 26th January 2013
110
 
111
- Goals and events [#103](https://github.com/morrisjs/morris.js/issues/103).
112
- Bower package manager metadata.
113
- More flexible formatters [#107](https://github.com/morrisjs/morris.js/issues/107).
114
- Color callbacks.
115
- Decade intervals for time-axis labels.
116
- Non-continous line tweaks [#116](https://github.com/morrisjs/morris.js/issues/116).
117
- Stacked bars [#120](https://github.com/morrisjs/morris.js/issues/120).
118
- HTML hover [#134](https://github.com/morrisjs/morris.js/issues/134).
119
- yLabelFormat [#139](https://github.com/morrisjs/morris.js/issues/139).
120
- Disable axes [#114](https://github.com/morrisjs/morris.js/issues/114).
121
 
122
### 0.3.3 - 1st November 2012
123
 
124
- **Bar charts!** [#101](https://github.com/morrisjs/morris.js/issues/101).
125
 
126
### 0.3.2 - 28th October 2012
127
 
128
- **Area charts!** [#47](https://github.com/morrisjs/morris.js/issues/47).
129
- Some major refactoring and test suite improvements.
130
- Set smooth parameter per series [#91](https://github.com/morrisjs/morris.js/issues/91).
131
- Custom dateFormat for string x-values [#90](https://github.com/morrisjs/morris.js/issues/90).
132
 
133
### 0.3.1 - 13th October 2012
134
 
135
- Add `formatter` option for customising value labels in donuts [#75](https://github.com/morrisjs/morris.js/issues/75).
136
- Cycle `lineColors` on line charts to avoid running out of colours [#78](https://github.com/morrisjs/morris.js/issues/78).
137
- Add method to select donut segments. [#79](https://github.com/morrisjs/morris.js/issues/79).
138
- Don't go negative on yMin when all y values are zero. [#80](https://github.com/morrisjs/morris.js/issues/80).
139
- Don't sort data when parseTime is false [#83](https://github.com/morrisjs/morris.js/issues/83).
140
- Customise styling for points. [#87](https://github.com/morrisjs/morris.js/issues/87).
141
 
142
### 0.3.0 - 15th September 2012
143
 
144
- Donut charts!
145
- Bugfix: ymin/ymax bug [#71](https://github.com/morrisjs/morris.js/issues/71).
146
- Bugfix: infinite loop when data indicates horizontal line [#66](https://github.com/morrisjs/morris.js/issues/66).
147
 
148
### 0.2.10 - 26th June 2012
149
 
150
- Support for decimal labels on y-axis [#58](https://github.com/morrisjs/morris.js/issues/58).
151
- Better axis label clipping [#63](https://github.com/morrisjs/morris.js/issues/63).
152
- Redraw graphs with updated data using `setData` method [#64](https://github.com/morrisjs/morris.js/issues/64).
153
- Bugfix: series with zero or one non-null values [#65](https://github.com/morrisjs/morris.js/issues/65).
154
 
155
### 0.2.9 - 15th May 2012
156
 
157
- Bugfix: Fix zero-value regression
158
- Bugfix: Don't modify user-supplied data
159
 
160
### 0.2.8 - 10th May 2012
161
 
162
- Customising x-axis labels with `xLabelFormat` option
163
- Only use timezones when timezone info is specified
164
- Fix old IE bugs (mostly in examples!)
165
- Added `preunits` and `postunits` options
166
- Better non-continuous series data support
167
 
168
### 0.2.7 - 2nd April 2012
169
 
170
- Added `xLabels` option
171
- Refactored x-axis labelling
172
- Better ISO date support
173
- Fix bug with single value in non time-series graphs
174
 
175
### 0.2.6 - 18th March 2012
176
 
177
- Partial series support (see `null` y-values in `examples/quarters.html`)
178
- `parseTime` option bugfix for non-time-series data
179
 
180
### 0.2.5 - 15th March 2012
181
 
182
- Raw millisecond timestamp support (with `dateFormat` option)
183
- YYYY-MM-DD HH:MM[:SS[.SSS]] date support
184
- Decimal number labels
185
 
186
### 0.2.4 - 8th March 2012
187
 
188
- Negative y-values support
189
- `ymin` option
190
- `units` options
191
 
192
### 0.2.3 - 6th Mar 2012
193
 
194
- jQuery no-conflict compatibility
195
- Support ISO week-number dates
196
- Optionally hide hover on mouseout (`hideHover`)
197
- Optionally skip parsing dates, treating X values as an equally-spaced series (`parseTime`)
198
 
199
### 0.2.2 - 29th Feb 2012
200
 
201
- Bugfix: mouseover error when options.data.length == 2
202
- Automatically sort options.data
203
 
204
### 0.2.1 - 28th Feb 2012
205
 
206
- Accept a DOM element *or* an ID in `options.element`
207
- Add `smooth` option
208
- Bugfix: clone `@default`
209
- Add `ymax` option
210
 
211
## License
212
 
213
Copyright (c) 2012-2014, Olly Smith
214
All rights reserved.
215
 
216
Redistribution and use in source and binary forms, with or without
217
modification, are permitted provided that the following conditions are met:
218
 
219
1. Redistributions of source code must retain the above copyright notice, this
220
   list of conditions and the following disclaimer.
221
2. Redistributions in binary form must reproduce the above copyright notice,
222
   this list of conditions and the following disclaimer in the documentation
223
   and/or other materials provided with the distribution.
224
 
225
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
226
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
227
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
228
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
229
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
230
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
231
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
232
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
233
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
234
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.