chartkick 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of chartkick might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -1
- data/README.md +21 -5
- data/chartkick.gemspec +0 -2
- data/lib/chartkick.rb +2 -1
- data/lib/chartkick/helper.rb +4 -2
- data/lib/chartkick/padrino.rb +3 -0
- data/lib/chartkick/rails.rb +5 -0
- data/lib/chartkick/version.rb +1 -1
- metadata +4 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 887154ecd859185c3907f75ebb240aa9ee516704
|
4
|
+
data.tar.gz: 5bded63b803870a2b8a305aaddc0205aa8ec429d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e953c7d8cbeac11247fd16b62dc20913af5d692abfc622c91682d3b656d02233768c092b4fe0b1378d71826847b18114d2907d307e111f967238cdb918f5ad47
|
7
|
+
data.tar.gz: 15116b19bf888405dfeea20d08d39c436a9aeda8d6ffb6a37670c113c3e48d688db7b5d68ae9150594562e89469cfbe26992b7f53b354c8d83f30fa070182645
|
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, Padrino and most browsers (including IE 6)
|
8
8
|
|
9
9
|
:two_hearts: A perfect companion to [groupdate](http://ankane.github.io/groupdate/)
|
10
10
|
|
@@ -102,9 +102,7 @@ Add this line to your application's Gemfile:
|
|
102
102
|
gem "chartkick"
|
103
103
|
```
|
104
104
|
|
105
|
-
And add the javascript files to your views.
|
106
|
-
|
107
|
-
**Note:** These files must be included **before** the helper methods.
|
105
|
+
And add the javascript files to your views. These files must be included **before** the helper methods.
|
108
106
|
|
109
107
|
For Google Charts, use:
|
110
108
|
|
@@ -118,9 +116,27 @@ If you prefer Highcharts, use:
|
|
118
116
|
<%= javascript_include_tag "path/to/highcharts.js", "chartkick" %>
|
119
117
|
```
|
120
118
|
|
119
|
+
### For Rails 3.1+
|
120
|
+
|
121
|
+
`chartkick.js` runs as a Rails engine - no need to install it.
|
122
|
+
|
123
|
+
### For Rails 2.3 and 3.0
|
124
|
+
|
125
|
+
You must include `chartkick.js` manually. [Download it here](https://raw.github.com/ankane/chartkick/master/app/assets/javascripts/chartkick.js)
|
126
|
+
|
127
|
+
### For Padrino
|
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
|
+
In addition, you must specify `http` or `https` if you use Google Charts, since Padrino tries to append `.js` to protocol relative urls.
|
132
|
+
|
133
|
+
```erb
|
134
|
+
<%= javascript_include_tag "https://www.google.com/jsapi", "chartkick" %>
|
135
|
+
```
|
136
|
+
|
121
137
|
## No Ruby? No Problem
|
122
138
|
|
123
|
-
Check out [chartkick.js](https://github.com/ankane/chartkick.js)
|
139
|
+
Check out [chartkick.js](https://github.com/ankane/chartkick.js)
|
124
140
|
|
125
141
|
## Credits
|
126
142
|
|
data/chartkick.gemspec
CHANGED
@@ -18,8 +18,6 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency "railties", ">= 3.1"
|
22
|
-
|
23
21
|
spec.add_development_dependency "bundler", "~> 1.3"
|
24
22
|
spec.add_development_dependency "rake"
|
25
23
|
end
|
data/lib/chartkick.rb
CHANGED
data/lib/chartkick/helper.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require "json"
|
2
|
+
|
1
3
|
module Chartkick
|
2
4
|
module Helper
|
3
5
|
|
@@ -25,10 +27,10 @@ module Chartkick
|
|
25
27
|
div_tag = content_tag :div, :id => element_id, :style => "height: #{height}; text-align: center; color: #999; line-height: #{height}; font-size: 14px; font-family: Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif;" do
|
26
28
|
concat "Loading..."
|
27
29
|
end
|
28
|
-
script_tag =
|
30
|
+
script_tag = content_tag :script do
|
29
31
|
concat "new Chartkick.#{klass}(#{element_id.to_json}, #{data_source.to_json}, #{options.to_json});".html_safe
|
30
32
|
end
|
31
|
-
div_tag + script_tag
|
33
|
+
div_tag + script_tag if div_tag # nil for padrino
|
32
34
|
end
|
33
35
|
|
34
36
|
end
|
data/lib/chartkick/version.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chartkick
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
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-
|
11
|
+
date: 2013-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: railties
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - '>='
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '3.1'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - '>='
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '3.1'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: bundler
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -70,6 +56,8 @@ files:
|
|
70
56
|
- lib/chartkick.rb
|
71
57
|
- lib/chartkick/engine.rb
|
72
58
|
- lib/chartkick/helper.rb
|
59
|
+
- lib/chartkick/padrino.rb
|
60
|
+
- lib/chartkick/rails.rb
|
73
61
|
- lib/chartkick/version.rb
|
74
62
|
homepage: ''
|
75
63
|
licenses:
|