simple_chartjs 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 3fd2e85bdd6c7ae86f23c7689c7ff51ce68a6343
4
- data.tar.gz: f7b3858f1ec10e0909aba49e3f2fccb07dab16ef
2
+ SHA256:
3
+ metadata.gz: ebf07f4cecde7ddf2dd09aca19c868116ca26f21dd3caae96bdf0318d53ad6a8
4
+ data.tar.gz: 77b3629a8d2ab8ce4db1a7bbff738879561c1b53562fd4d82979cdda6dd94897
5
5
  SHA512:
6
- metadata.gz: 528a8e4e3e0626021213f828a8cf60413df016434b9aac9cc46ae327e471e5a45d491f4a84611042be393c128ce4ba9a3ff0ea35e9582743c5bc9890cf7dad7a
7
- data.tar.gz: d6b4f9197e8d643b1e84996b3dc186aea2616056def906fab11918cbc9f4de664cc5be0c57dc2f07014e3128ced916a75eeddbc3c3e5537a0dae8dd8b65cdef4
6
+ metadata.gz: dd412c6171b085176a1f94720254dd58664f8ddbfd6fe81657129c028175a7572db5aa6df7701687657092f8d9cd7a55add3c9e35bded9f8e1b713f42e1c992c
7
+ data.tar.gz: 3eb1d43f469f950aa3e08216f53a6112fa16adb4dc86b54b1f9cfd4ffb2d97f95e842f558904215d9691fb0e7f538dcc12483ee8ff9264e797bc837392d8bb54
data/README.md CHANGED
@@ -21,12 +21,12 @@ MomentJS:
21
21
 
22
22
  - Without Moment.js:
23
23
  ```javascript
24
- //= require Chart.min
24
+ //= require Chart
25
25
  ```
26
26
 
27
27
  - With Moment.js:
28
28
  ```javascript
29
- //= require Chart.bundle.min
29
+ //= require Chart.bundle
30
30
  ```
31
31
 
32
32
  Then require the simple_chartjs file
@@ -49,23 +49,32 @@ For faster load times simple chartjs expects you to have controllers and routes
49
49
 
50
50
  ```ruby
51
51
  class ChartsController < ApplicationController
52
+ def show
53
+ render json: chart_data.to_json
54
+ end
55
+
56
+ private
57
+
52
58
  def chart_data
53
- render json: Model.group_by_day(:completed_at).count
59
+ {
60
+ datasets: [{ data: [...] }],
61
+ labels: [...]
62
+ }
54
63
  end
55
64
  end
56
65
  ```
57
66
 
58
67
  At its simplest a chart can be produced by the following
59
68
  ```erb
60
- <%= line_chart chart_data_path %>
61
- <%= bar_chart chart_data_path %>
62
- <%= horizontal_bar_chart chart_data_path %>
63
- <%= radar_chart chart_data_path %>
64
- <%= polar_area_chart chart_data_path %>
65
- <%= pie_chart chart_data_path %>
66
- <%= doughnut_chart chart_data_path %>
67
- <%= bubble_chart chart_data_path %>
68
- <%= scatter_chart chart_data_path %>
69
+ <%= line_chart chart_path %>
70
+ <%= bar_chart chart_path %>
71
+ <%= horizontal_bar_chart chart_path %>
72
+ <%= radar_chart chart_path %>
73
+ <%= polar_area_chart chart_path %>
74
+ <%= pie_chart chart_path %>
75
+ <%= doughnut_chart chart_path %>
76
+ <%= bubble_chart chart_path %>
77
+ <%= scatter_chart chart_path %>
69
78
  ```
70
79
 
71
80
  ### HTML Options
@@ -114,7 +114,7 @@ SimpleChart.prototype.formatRubyObject = function(object) {
114
114
  };
115
115
 
116
116
  SimpleChart.prototype.convertToCamelCase = function(string) {
117
- return string.replace(/[-_]([a-z])/, function(_, letter) {
117
+ return string.replace(/[-_]([a-z])/g, function(_, letter) {
118
118
  return letter.toUpperCase();
119
119
  });
120
120
  };
@@ -1,3 +1,3 @@
1
1
  module SimpleChartjs
2
- VERSION = '1.0.6'.freeze
2
+ VERSION = '1.0.7'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_chartjs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Harry Venables
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-12-29 00:00:00.000000000 Z
11
+ date: 2018-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  version: '0'
116
116
  requirements: []
117
117
  rubyforge_project:
118
- rubygems_version: 2.6.11
118
+ rubygems_version: 2.7.6
119
119
  signing_key:
120
120
  specification_version: 4
121
121
  summary: Chartjs for Rails