lazy_high_charts 1.4.3 → 1.5.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/CHANGELOG.md +4 -0
- data/GEM_VERSION +1 -1
- data/README.md +2 -0
- data/lib/lazy_high_charts/high_chart.rb +4 -6
- data/lib/lazy_high_charts/layout_helper.rb +1 -1
- data/spec/high_chart_spec.rb +4 -4
- metadata +3 -3
- metadata.gz.sig +1 -3
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
data/GEM_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.5.0.beta1
|
data/README.md
CHANGED
@@ -4,6 +4,8 @@ Easily include HighCharts in your project with this gem
|
|
4
4
|
[![Build Status](https://secure.travis-ci.org/michelson/lazy_high_charts.png)](http://travis-ci.org/michelson/lazy_high_charts)
|
5
5
|
|
6
6
|
## Notice
|
7
|
+
[![Gem
|
8
|
+
Version](https://badge.fury.io/rb/lazy_high_charts.png)](http://badge.fury.io/rb/lazy_high_charts)
|
7
9
|
Current
|
8
10
|
[VERSION](https://github.com/michelson/lazy_high_charts/blob/master/GEM_VERSION)
|
9
11
|
[ChangeLog](https://github.com/michelson/lazy_high_charts/blob/master/CHANGELOG.md)
|
@@ -3,17 +3,16 @@ module LazyHighCharts
|
|
3
3
|
class HighChart
|
4
4
|
include LayoutHelper
|
5
5
|
|
6
|
-
SERIES_OPTIONS = %w(data
|
6
|
+
SERIES_OPTIONS = %w(data index legendIndex name stack type xAxis yAxis)
|
7
7
|
|
8
|
-
attr_accessor :
|
8
|
+
attr_accessor :series_data, :options, :placeholder, :html_options
|
9
9
|
alias :canvas :placeholder
|
10
10
|
alias :canvas= :placeholder=
|
11
11
|
|
12
12
|
def initialize(canvas = nil, html_opts = {})
|
13
13
|
|
14
|
-
@collection_filter = nil
|
15
14
|
self.tap do |high_chart|
|
16
|
-
high_chart.
|
15
|
+
high_chart.series_data ||= []
|
17
16
|
high_chart.options ||= {}
|
18
17
|
high_chart.defaults_options
|
19
18
|
high_chart.html_options ||= html_opts
|
@@ -53,9 +52,8 @@ module LazyHighCharts
|
|
53
52
|
# @high_chart.series :name=>'Updated', :data=>data
|
54
53
|
# @high_chart.series :name=>'Updated', :data=>[5, 1, 6, 1, 5, 4, 9]
|
55
54
|
def series(opts = {})
|
56
|
-
@data ||= []
|
57
55
|
if not opts.empty?
|
58
|
-
@
|
56
|
+
@series_data << OptionsKeyFilter.filter(opts.merge(:name => opts[:name], :data => opts[:data]))
|
59
57
|
end
|
60
58
|
end
|
61
59
|
|
@@ -25,7 +25,7 @@ module LazyHighCharts
|
|
25
25
|
|
26
26
|
def build_html_output(type, placeholder, object, &block)
|
27
27
|
options_collection = [generate_json_from_hash(OptionsKeyFilter.filter(object.options))]
|
28
|
-
options_collection << %|"series": [#{generate_json_from_array(object.
|
28
|
+
options_collection << %|"series": [#{generate_json_from_array(object.series_data)}]|
|
29
29
|
|
30
30
|
core_js =<<-EOJS
|
31
31
|
var options = { #{options_collection.join(',')} };
|
data/spec/high_chart_spec.rb
CHANGED
@@ -48,12 +48,12 @@ describe "HighChart" do
|
|
48
48
|
end
|
49
49
|
|
50
50
|
it "should set data empty by default" do
|
51
|
-
LazyHighCharts::HighChart.new.
|
51
|
+
LazyHighCharts::HighChart.new.series_data.should == []
|
52
52
|
end
|
53
53
|
|
54
54
|
it "should take a block setting attributes" do
|
55
|
-
chart = LazyHighCharts::HighChart.new { |f| f.
|
56
|
-
chart.
|
55
|
+
chart = LazyHighCharts::HighChart.new { |f| f.series_data = @data; f.options = @options }
|
56
|
+
chart.series_data.should == @data
|
57
57
|
chart.options.should == @options
|
58
58
|
end
|
59
59
|
|
@@ -77,7 +77,7 @@ describe "HighChart" do
|
|
77
77
|
f.options[:legend][:layout] = "horizontal"
|
78
78
|
f.options[:xAxis][:categories] = ["uno", "dos", "tres", "cuatro"]
|
79
79
|
end
|
80
|
-
chart.
|
80
|
+
chart.series_data.should == [{:name => "John", :data => [3, 20]}, {:name => "Jane", :data => [1, 3]}]
|
81
81
|
chart.options[:legend][:layout].should == "horizontal"
|
82
82
|
chart.options[:xAxis][:categories].should == ["uno", "dos", "tres", "cuatro"]
|
83
83
|
chart.options[:chart][:defaultSeriesType].should == "area"
|
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lazy_high_charts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
5
|
-
prerelease:
|
4
|
+
version: 1.5.0.beta1
|
5
|
+
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Miguel Michelson
|
@@ -39,7 +39,7 @@ cert_chain:
|
|
39
39
|
RG1HRmx5aQpQRnJxdGF2UDkzakpyWnRaMHpqZWtJU1hYS1UybnZXWXladG1M
|
40
40
|
ZmJPOUtudjFVcHl0Q0ljNHN4NUNtL0pZQXZ3ClExRnNhK2ZtUFFRNklLS2EK
|
41
41
|
LS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
|
42
|
-
date: 2013-07-
|
42
|
+
date: 2013-07-21 00:00:00.000000000 Z
|
43
43
|
dependencies:
|
44
44
|
- !ruby/object:Gem::Dependency
|
45
45
|
name: bundler
|
metadata.gz.sig
CHANGED
@@ -1,3 +1 @@
|
|
1
|
-
4
|
2
|
-
��l�
|
3
|
-
xG�Kgc����%���׀��{�����J�u���T?�Mʺ�i��Y|�Ѕ.C��L�u���̙���FQi��^��s��#2ՒL�B!$��ɵIvb�8���ѳ�!�=���Ҡ�(>O�ޟ��3O��l��e�T �x
|
1
|
+
^�FE�$�}��4�howm��(��U�Dz�H��h��qK�9��B��rݵn�>�N��.i��Y�C�l��6�'||Q��R���%��M-�+�*����)�A��B�bH1k(�ڰd�X��
|