amcharts.rb 3.11.2.16 → 3.11.2.17

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7e19fd3b6a3789454f36a4f50aab44f91f61819a
4
- data.tar.gz: 35c1dd52506d4d363bd033725b7773e8dc4662f9
3
+ metadata.gz: f1126b2a118fa04b97ba281e798c9c8c33879902
4
+ data.tar.gz: 1a658158276448377dbd9666944449aaa779b3f8
5
5
  SHA512:
6
- metadata.gz: af22d0284a38073ba059438556a576c2c8c15b9c0d2c346b88347798511775b2ec8b6cd40de72442f187d3d94a4d17afdf4005b9c225ec797282bd8f36b1caa0
7
- data.tar.gz: f02f741de839469e1d63159a83dd1083671dc92876e70a72e9b68c1bb9dbd0eff6cfb416e3a0f9feea97466d07baf782998473d2cbcbbf10904a7ae4901c22a6
6
+ metadata.gz: dc84fae07d61e742d37e9f7b858b2b16ff9e568181c6a882fa22e276840fb01e7bdab3d16bcbafae1ec4d26c6dd5cce114727626050f4b5be18692a6bce7109c
7
+ data.tar.gz: 12f6abb7f8751a68dde8ed4f44ff76fc9816d421f905cd48e08908b195812bc78787a0417bd6e3a7c4463f1f2dd21003cfa0b84589a5fff5dec3b4bed5de0b0d
@@ -0,0 +1 @@
1
+ <%= function %>(chart);
@@ -41,7 +41,9 @@ AmCharts.ready(function() {
41
41
 
42
42
  <% builder.render_export %>
43
43
 
44
+ <% builder.render_functions %>
45
+
44
46
  chart.write('<%= container %>');
45
47
 
46
48
  AmCharts.RB.Helpers.load_from_immediate_provider(chart);
47
- });
49
+ });
@@ -18,7 +18,7 @@ module AmCharts
18
18
  class_attribute :default_settings
19
19
  attr_accessor :data_provider, :data_source, :container
20
20
  attr_accessor :width, :height, :loading_indicator
21
- attr_reader :titles, :labels, :graphs, :legends, :data, :settings, :listeners, :legend_div, :export
21
+ attr_reader :titles, :labels, :graphs, :legends, :data, :settings, :listeners, :legend_div, :export, :functions
22
22
 
23
23
  def initialize(*data, &block)
24
24
  @data = data.flatten
@@ -30,6 +30,7 @@ module AmCharts
30
30
  @export = nil
31
31
  @titles = []
32
32
  @labels = []
33
+ @functions = []
33
34
 
34
35
  update_settings(&block) if block_given?
35
36
  end
@@ -148,6 +149,10 @@ module AmCharts
148
149
  []
149
150
  end
150
151
 
152
+ def call_function(fn)
153
+ @functions << fn
154
+ end
155
+
151
156
  private
152
157
 
153
158
  def get_dimension_value(value)
@@ -97,6 +97,12 @@ module AmCharts
97
97
  concat render_js('export', object: chart.export)
98
98
  end
99
99
 
100
+ def render_functions
101
+ chart.functions.each do |fn|
102
+ concat render_js('function', object: fn)
103
+ end
104
+ end
105
+
100
106
  private
101
107
 
102
108
  def method_missing(*args, &block)
@@ -109,4 +115,4 @@ module AmCharts
109
115
  super
110
116
  end
111
117
  end
112
- end
118
+ end
@@ -1,3 +1,3 @@
1
1
  module AmCharts
2
- VERSION = '3.11.2.16'
2
+ VERSION = '3.11.2.17'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amcharts.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.11.2.16
4
+ version: 3.11.2.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Vandersluis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-04 00:00:00.000000000 Z
11
+ date: 2017-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -174,6 +174,7 @@ files:
174
174
  - app/views/amcharts/_data.erb
175
175
  - app/views/amcharts/_data_source.erb
176
176
  - app/views/amcharts/_export.erb
177
+ - app/views/amcharts/_function.erb
177
178
  - app/views/amcharts/_immediate_data_load.erb
178
179
  - app/views/amcharts/_label.erb
179
180
  - app/views/amcharts/_legend.erb