https://github.com/visionmedia/histogram
JavaScript canvas histogram component
https://github.com/visionmedia/histogram
Last synced: 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 (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-06-22T16:01:14.000Z (about 12 years ago)
- Last Synced: 2025-04-04T18:12:49.779Z (3 months ago)
- Language: JavaScript
- Size: 122 KB
- Stars: 69
- Watchers: 6
- 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.


## 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