README.md in metrics-graphics-rails-2.1.3 vs README.md in metrics-graphics-rails-2.1.3.2
- old
+ new
@@ -7,11 +7,11 @@
## Usage
Add this gem to your Gemfile:
- gem 'metrics-graphics-rails', github: 'dgilperez/metrics-graphics-rails'
+ gem 'metrics-graphics-rails'
Add the following directive to your Javascript manifest file (application.js), after the `//= require jquery`:
//= require metrics-graphics-rails
@@ -38,17 +38,19 @@
{'date':new Date('2014-11-02'),'value':18}],
width: 600,
height: 250,
target: '#downloads',
x_accessor: 'date',
- y_accessor: 'value',
+ y_accessor: 'value'
})
This graph can be rendered in a Rails view template with this helper:
- = metrics_graphic_for data, title: "Downloads", description: "This graphic shows a time-series of downloads.", width: 600, height: 250, target: '#downloads', x_accessor: 'date', y_accessor: 'value'
+ = metrics_graphic_for data, title: "Downloads", description: "This graphic shows a time-series of downloads.", width: 600, height: 250, target: '#downloads', x_accessor: 'date', y_accessor: 'value', time_format: '%Y-%m-%d'
-where ``data`` is an Array of Hashes of points with a ``date`` and a ``value`` keys and values. Ex: ``[{date: '2014-11-01', value: 12}, date: '2014-11-02', value: 18}]``
+where ``data`` is an Array of Hashes of points with a ``date`` and a ``value`` keys and values. Ex: ``[{date: '2014-11-01', value: 12}, {date: '2014-11-02', value: 18}]``
+
+`width`, `height`, `time_format` and `description` are optional options.
## Versioning
metrics-graphics-rails 2.1.3 == metrics-graphics 2.1.3