chartkick 1.1.0 → 1.1.1
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +10 -1
- data/lib/chartkick.rb +1 -1
- data/lib/chartkick/helper.rb +10 -8
- data/lib/chartkick/{padrino.rb → sinatra.rb} +1 -1
- data/lib/chartkick/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 30de4fc2979a15f05f88ea0b616f62165f44af98
|
|
4
|
+
data.tar.gz: 3ce7c4dcc8cc46808a071beb0893631f2a21c2ea
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c112540f2ab9e67a2a0438f034c3297c7b328e73a9c693e3ce84460a9e089735e20d7273fff294ab6e9d4693d74fa2619ae6352fb74aaf2288a3b3c602197ca1
|
|
7
|
+
data.tar.gz: 19460f79f6cfdd72025902fb2816167878356f8bf7b01c4b22dbfad9ae024a5ffe0e095d3d5dd4eda719eb98ff5db46d441360a4f060e4ce8631e0b305af5753
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Create beautiful Javascript charts with one line of Ruby. No more fighting with
|
|
|
4
4
|
|
|
5
5
|
[See it in action](http://ankane.github.io/chartkick/)
|
|
6
6
|
|
|
7
|
-
Works with Rails,
|
|
7
|
+
Works with Rails, Sinatra and most browsers (including IE 6)
|
|
8
8
|
|
|
9
9
|
:two_hearts: A perfect companion to [groupdate](http://ankane.github.io/groupdate/)
|
|
10
10
|
|
|
@@ -124,6 +124,15 @@ If you prefer Highcharts, use:
|
|
|
124
124
|
|
|
125
125
|
You must include `chartkick.js` manually. [Download it here](https://raw.github.com/ankane/chartkick/master/app/assets/javascripts/chartkick.js)
|
|
126
126
|
|
|
127
|
+
### For Sinatra
|
|
128
|
+
|
|
129
|
+
You must include `chartkick.js` manually. [Download it here](https://raw.github.com/ankane/chartkick/master/app/assets/javascripts/chartkick.js)
|
|
130
|
+
|
|
131
|
+
```html
|
|
132
|
+
<script src="//www.google.com/jsapi"></script>
|
|
133
|
+
<script src="chartkick.js"></script>
|
|
134
|
+
```
|
|
135
|
+
|
|
127
136
|
### For Padrino
|
|
128
137
|
|
|
129
138
|
You must include `chartkick.js` manually. [Download it here](https://raw.github.com/ankane/chartkick/master/app/assets/javascripts/chartkick.js)
|
data/lib/chartkick.rb
CHANGED
data/lib/chartkick/helper.rb
CHANGED
|
@@ -23,14 +23,16 @@ module Chartkick
|
|
|
23
23
|
element_id = options.delete(:id) || "chart-#{@chartkick_chart_id += 1}"
|
|
24
24
|
height = options.delete(:height) || "300px"
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
html = <<HTML
|
|
27
|
+
<div id="#{ERB::Util.html_escape(element_id)}" style="height: #{ERB::Util.html_escape(height)}; text-align: center; color: #999; line-height: #{ERB::Util.html_escape(height)}; font-size: 14px; font-family: 'Lucida Grande', 'Lucida Sans Unicode', Verdana, Arial, Helvetica, sans-serif;">
|
|
28
|
+
Loading...
|
|
29
|
+
</div>
|
|
30
|
+
<script type="text/javascript">
|
|
31
|
+
new Chartkick.#{klass}(#{element_id.to_json}, #{data_source.to_json}, #{options.to_json});
|
|
32
|
+
</script>
|
|
33
|
+
HTML
|
|
34
|
+
|
|
35
|
+
html.respond_to?(:html_safe) ? html.html_safe : html
|
|
34
36
|
end
|
|
35
37
|
|
|
36
38
|
end
|
data/lib/chartkick/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: chartkick
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andrew Kane
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2013-06-
|
|
11
|
+
date: 2013-06-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -56,8 +56,8 @@ files:
|
|
|
56
56
|
- lib/chartkick.rb
|
|
57
57
|
- lib/chartkick/engine.rb
|
|
58
58
|
- lib/chartkick/helper.rb
|
|
59
|
-
- lib/chartkick/padrino.rb
|
|
60
59
|
- lib/chartkick/rails.rb
|
|
60
|
+
- lib/chartkick/sinatra.rb
|
|
61
61
|
- lib/chartkick/version.rb
|
|
62
62
|
homepage: ''
|
|
63
63
|
licenses:
|