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 +5 -5
- data/README.md +21 -12
- data/app/assets/javascripts/simple_chartjs.js +1 -1
- data/lib/chartjs/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ebf07f4cecde7ddf2dd09aca19c868116ca26f21dd3caae96bdf0318d53ad6a8
|
4
|
+
data.tar.gz: 77b3629a8d2ab8ce4db1a7bbff738879561c1b53562fd4d82979cdda6dd94897
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
24
|
+
//= require Chart
|
25
25
|
```
|
26
26
|
|
27
27
|
- With Moment.js:
|
28
28
|
```javascript
|
29
|
-
//= require Chart.bundle
|
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
|
-
|
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
|
61
|
-
<%= bar_chart
|
62
|
-
<%= horizontal_bar_chart
|
63
|
-
<%= radar_chart
|
64
|
-
<%= polar_area_chart
|
65
|
-
<%= pie_chart
|
66
|
-
<%= doughnut_chart
|
67
|
-
<%= bubble_chart
|
68
|
-
<%= scatter_chart
|
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])
|
117
|
+
return string.replace(/[-_]([a-z])/g, function(_, letter) {
|
118
118
|
return letter.toUpperCase();
|
119
119
|
});
|
120
120
|
};
|
data/lib/chartjs/version.rb
CHANGED
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.
|
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:
|
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
|
118
|
+
rubygems_version: 2.7.6
|
119
119
|
signing_key:
|
120
120
|
specification_version: 4
|
121
121
|
summary: Chartjs for Rails
|