JqueryVisualize
This is gem for jQuery-Visualize plugin.
https://github.com/filamentgroup/jQuery-Visualize
Installation
Add this line to your application's Gemfile:
gem 'jquery_visualize'
And then execute:
$ bundle
Or install it yourself as:
$ gem install jquery_visualize
Usage
How to use Visualize
First, you'll need to create the table markup:
...repetitive rows removed for brevity.
2009 Employee Sales by Department | food | auto | household | furniture | kitchen | bath |
---|
Mary | 190 | 160 | 40 | 120 | 30 | 70 |
---|
Tom | 3 | 40 | 30 | 45 | 35 | 49 |
---|
Note that we've used a caption element to summarize the table data. This will be used by the Visualize plugin to create a title on your graph. We've also defined our table headings using th elements, letting the script know which cells it should use as the titles for a data set.
Now that we have our HTML table, we can generate a chart. Just attach jQuery and our Visualize plugin's JavaScript and CSS files to your page, and call the visualize() method on the table, like this:
$('table').visualize();
That's it! By default, the Visualize plugin will generate the first bar chart shown above and append it to your page directly after the table.
Documentation:
http://www.filamentgroup.com/lab/update_to_jquery_visualize_accessible_charts_with_html5_from_designing_with/
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request