README.md in swagchart-1.0.0 vs README.md in swagchart-1.1.0

- old
+ new

@@ -1,12 +1,14 @@ # Swagchart +[![Gem Version](https://badge.fury.io/rb/swagchart.svg)](http://badge.fury.io/rb/swagchart) ![Installs](http://img.shields.io/gem/dt/swagchart.svg) + Get your swag on with this incredibly easy to use wrapper around [Googles Chart API](https://developers.google.com/chart/). In case you haven't noticed, Swagchart is just an acronym for **S**.imple **W**.rapper **A**.round **G**.oogle **Chart**. -Swagchart is highly inspired by [Chartkick](https://github.com/ankane/chartkick) but making use of Googles new ChartWrapper class which allows a more flexible and direct interaction. +Swagchart is highly inspired by [Chartkick](https://github.com/ankane/chartkick) ~~but making use of Googles new ChartWrapper class which allows a more flexible and direct interaction.~~ (the code is still in there and you can enable it if you want to .. look at lib/swagchart/helper.rb .. but unfortunately ChartWrapper doesn't allow many charts so I switched back to the classic approach by default). You can still create beautiful Javascript charts with one line of Ruby. In fact now you can pretty much use all the fancy chart types from [Googles Chart API](https://developers.google.com/chart/interactive/docs/gallery). Works with Rails, Sinatra and most browsers (including IE 6). @@ -22,16 +24,10 @@ ```erb <%= chart 'PieChart', Goal.group(:name).count %> ``` -~~Keep in mind that camelize is only available with activesupport. Use the camelized chart names ... i.e. "LineChart" instead of "line_chart"~~ - -:thought_balloon: ... Note to self: Include more examples ... - - - ### Data Pass data as a Array, Hash or "DataTable" ```erb @@ -47,10 +43,22 @@ ``` Multiple series just work automatically ```erb -<%= chart :line_chart [[1,2,4],[2,3,8],[3,4,16],[4,5,32]], columns: ['x', 'Series 1', 'Series 2'] %> +<%= chart :line_chart, [[1,2,4],[2,3,8],[3,4,16],[4,5,32]], columns: ['x', 'Series 1', 'Series 2'] %> +``` + +No need to define columns if you don't want to + +```erb +<%= chart :line_chart, [[1,2,4],[2,3,8],[3,4,16],[4,5,32]] %> +``` + +:sparkles: Now brand new: Instead of actual data you can just provide an URL from where the data will be retrieved via an Ajax Get request + +```erb +<%= chart :line_chart, '/api/line-chart-data' %> ``` If you want to use times or dates, do so. They have to be a time or date object!