gruffy 1.2.0 → 1.2.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/lib/gruffy/side_stacked_bar.rb +2 -26
- data/lib/gruffy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf185c492f9f6f41ecdfc72b3a3f158ce1ff9a05
|
4
|
+
data.tar.gz: a13e091fca761ae7a9decc122942dc5c18198da0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 015bb83242ce23f1f551576368b3d813a6a0d44f088094e934c7efbb90d359de20bc978930e30c2f24694643c1ab5191ce82d85c05e444a2f416b1ed3c51f7f9
|
7
|
+
data.tar.gz: af1a381aefcf05fe19b1add9b309ef873bb8549977037959b6600b9a5d76f4d20bc492954c7c0ede4751b997dc35a24ebea8c4f7161b782ba6e21d5153563e87
|
@@ -33,38 +33,13 @@ class Gruffy::SideStackedBar < Gruffy::SideBar
|
|
33
33
|
0.upto(@column_count-1) {|i| label_values[i] = {:value => 0, :right_x => 0}}
|
34
34
|
end
|
35
35
|
|
36
|
-
difference_pixels = []
|
37
|
-
@norm_data.each do |data_row|
|
38
|
-
temps = []
|
39
|
-
data_row[DATA_VALUES_INDEX].each_with_index do |data_point, point_index|
|
40
|
-
temp1 = @graph_left + (@graph_width - data_point * @graph_width - height[point_index])
|
41
|
-
temp2 = @graph_left + @graph_width - height[point_index]
|
42
|
-
temps << (temp2 - temp1)
|
43
|
-
end
|
44
|
-
|
45
|
-
difference_pixels << temps
|
46
|
-
end
|
47
|
-
|
48
|
-
difference_count = 1
|
49
|
-
begin
|
50
|
-
temps = difference_pixels.first
|
51
|
-
difference_pixels.shift
|
52
|
-
difference_pixels.each {|t| temps = temps.zip(t) }
|
53
|
-
difference_count = temps.first.flatten.length
|
54
|
-
temps = temps.map {|r| r.flatten.sum }
|
55
|
-
difference_pixels = temps
|
56
|
-
rescue
|
57
|
-
end
|
58
|
-
|
59
36
|
@norm_data.each_with_index do |data_row, row_index|
|
60
37
|
data_row[DATA_VALUES_INDEX].each_with_index do |data_point, point_index|
|
61
38
|
## using the original calcs from the stacked bar chart to get the difference between
|
62
39
|
## part of the bart chart we wish to stack.
|
63
|
-
pixel_missing = ((@graph_width - difference_pixels[point_index].to_s.to_f) / difference_count)
|
64
|
-
|
65
40
|
temp1 = @graph_left + (@graph_width - data_point * @graph_width - height[point_index])
|
66
41
|
temp2 = @graph_left + @graph_width - height[point_index]
|
67
|
-
difference = temp2 - temp1
|
42
|
+
difference = temp2 - temp1
|
68
43
|
|
69
44
|
@d = @d.fill data_row[DATA_COLOR_INDEX]
|
70
45
|
|
@@ -77,6 +52,7 @@ class Gruffy::SideStackedBar < Gruffy::SideBar
|
|
77
52
|
length[point_index] += difference
|
78
53
|
height[point_index] += (data_point * @graph_width - 2)
|
79
54
|
|
55
|
+
|
80
56
|
if @show_labels_for_bar_values
|
81
57
|
label_values[point_index][:value] += @norm_data[row_index][3][point_index]
|
82
58
|
label_values[point_index][:right_x] = right_x
|
data/lib/gruffy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gruffy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wuttikrai Limsakul
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rmagick
|