birt 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/application_helper.rb +6 -0
- data/app/views/birt_test/index.html.erb +1 -3
- data/lib/assets/javascripts/birt.js +1 -1
- data/lib/assets/javascripts/birt/birt.js +1 -1
- data/lib/birt/core/chart/line_chart_report.rb +5 -6
- data/lib/birt/core/chart/series_row.rb +13 -0
- data/lib/birt/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49ffc32249260e8dc1446bd5a0810a334540cd14
|
4
|
+
data.tar.gz: d45a3870ce134548c63b0499d5bdc8cd6be63d7a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c6a97f3c6b71bdae08154b8a92784814e4c66d966f1ef1c87afb7275a5710bd88b3a7c4e0b49b7ddb1ca03abda5e9846f2225bed4215b23c19770b21649b2d4
|
7
|
+
data.tar.gz: 495e0ff386d49102a3ff847f10dba06749b2cd811515e0f61e4f9289e681c5fe7d74e16e4db1c6cf508c34f6df8195682f3bdc953e10d8e4607a4dd3fe3263fe
|
@@ -19,7 +19,7 @@ var Birt = (function () {
|
|
19
19
|
$.birtLoading();
|
20
20
|
$.ajax(
|
21
21
|
{
|
22
|
-
url: '/birt/api.json?_report={0}'.format(rptDesignName),
|
22
|
+
url: '/birt/api.json?_report={0}'.format(rptDesignName||$birt.data('rptdesign')),
|
23
23
|
type: 'GET',
|
24
24
|
success: function (data) {
|
25
25
|
$.birtLoading('hide');
|
@@ -22,11 +22,10 @@ class Birt::Core::LineChartReport < Birt::Core::BaseReport
|
|
22
22
|
@horizontal_row = elem_text(xml_e, "/model:ChartWithAxes/Axes/SeriesDefinitions/Series/DataDefinition/Definition").gsub("row[\"", '').gsub("\"]", '')
|
23
23
|
|
24
24
|
|
25
|
-
xml_e.get_elements("/model:ChartWithAxes/Axes/AssociatedAxes/SeriesDefinitions/Series[@xsi:type='type:LineSeries']
|
26
|
-
@series_rows <<
|
25
|
+
xml_e.get_elements("/model:ChartWithAxes/Axes/AssociatedAxes/SeriesDefinitions/Series[@xsi:type='type:LineSeries']").each do |item|
|
26
|
+
@series_rows << Birt::Core::SeriesRow.new(item)
|
27
27
|
end
|
28
28
|
|
29
|
-
# @series_rows << elem_text(xml_e, "/model:ChartWithAxes/Axes/AssociatedAxes/SeriesDefinitions/Series[@xsi:type='type:LineSeries']/DataDefinition/Definition").gsub("row[\"", '').gsub("\"]", '')
|
30
29
|
end
|
31
30
|
|
32
31
|
yield(self) if block_given?
|
@@ -51,10 +50,10 @@ class Birt::Core::LineChartReport < Birt::Core::BaseReport
|
|
51
50
|
|
52
51
|
@json[:x_data] = data_set_result.columns[data_set_result.column_headers.index(@horizontal_row)]
|
53
52
|
@json[:series] = []
|
54
|
-
@series_rows.each { |
|
53
|
+
@series_rows.each { |series_row|
|
55
54
|
@json[:series] << {
|
56
|
-
name:
|
57
|
-
data: _series_data.call(data_set_result,
|
55
|
+
name: series_row.display_name,
|
56
|
+
data: _series_data.call(data_set_result, series_row.column_name)
|
58
57
|
}
|
59
58
|
}
|
60
59
|
@json
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class Birt::Core::SeriesRow< Birt::Core::BaseReport
|
2
|
+
|
3
|
+
attr_accessor :column_name
|
4
|
+
attr_accessor :display_name
|
5
|
+
|
6
|
+
def initialize(xml_e)
|
7
|
+
super(xml_e) do
|
8
|
+
@column_name = elem_text(xml_e,"DataDefinition/Definition").gsub("row[\"", '').gsub("\"]", '')
|
9
|
+
@display_name = elem_text(xml_e,"SeriesIdentifier")
|
10
|
+
end
|
11
|
+
yield(self) if block_given?
|
12
|
+
end
|
13
|
+
end
|
data/lib/birt/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: birt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- saxer
|
@@ -116,6 +116,7 @@ files:
|
|
116
116
|
- app/controllers/application_controller.rb
|
117
117
|
- app/controllers/birt/api_controller.rb
|
118
118
|
- app/controllers/birt_test_controller.rb
|
119
|
+
- app/helpers/application_helper.rb
|
119
120
|
- app/helpers/birt/api_helper.rb
|
120
121
|
- app/views/birt/api/index.json.jbuilder
|
121
122
|
- app/views/birt_test/index.html.erb
|
@@ -143,6 +144,7 @@ files:
|
|
143
144
|
- lib/birt/core.rb
|
144
145
|
- lib/birt/core/base_report.rb
|
145
146
|
- lib/birt/core/chart/line_chart_report.rb
|
147
|
+
- lib/birt/core/chart/series_row.rb
|
146
148
|
- lib/birt/core/data_set.rb
|
147
149
|
- lib/birt/core/data_set_result.rb
|
148
150
|
- lib/birt/core/data_source.rb
|