Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/visionmedia/histogram
JavaScript canvas histogram component
https://github.com/visionmedia/histogram
Last synced: about 2 months ago
JSON representation
JavaScript canvas histogram component
- Host: GitHub
- URL: https://github.com/visionmedia/histogram
- Owner: visionmedia
- Created: 2013-03-22T16:37:28.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-06-22T16:01:14.000Z (over 11 years ago)
- Last Synced: 2024-05-08T16:56:03.290Z (8 months ago)
- Language: JavaScript
- Size: 122 KB
- Stars: 68
- Watchers: 7
- Forks: 9
- Open Issues: 6
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
Awesome Lists containing this project
README
# histogram
JavaScript histogram component for arbitrary data.
![large histogram](http://cdn.dropmark.com/41933/c8fda5acfa0f3b72c8f37b7ad13fb2e6e4e47d2e/big.png)
![medium histogram](http://cdn.dropmark.com/41933/48aed33dbe309fd3ab1196d883b3ca7d4d5c48a9/medium.png)
## Installation
$ component install visionmedia/histogram
## API
### Histogram()
Initialize a new histogram.
### Histogram.add(data:Array, options:Object)
Add `data` set with `options`:
- `color` bar color
### Histogram.size(w:Number, h:Number)
Set size to `w` / `h`.
### Histogram.bins(n:Number)
Set the total number of bins to `n`.
### Histogram.render()
Render the histogram and return a canvas.
## License
MIT