pill_chart 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pill_chart/simple_pill_chart.rb +5 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6caa8f5bc8e610ff73f24218f4341b367dc6660
|
4
|
+
data.tar.gz: 7629915095214c95ea439242f5a884966914ca32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 330136c65db70b0a01c41c98c038b251cb904c81b172077bf514173bbcf29d9f6fab03d7474740fb626ba04835d9439f11b6b803cd2ee0e2868e0f9f4b1620b7
|
7
|
+
data.tar.gz: 72575f650b69443ea70b94367df0432c52f8d5a66eea2c2d693de4108ded239a36d61baa184c0e8590afdbf94e8e9d18af223fe74531143819b824fb05520e72
|
@@ -21,7 +21,8 @@ module PillChart
|
|
21
21
|
@width, @height = width, height
|
22
22
|
@paths = []
|
23
23
|
@type = type
|
24
|
-
@
|
24
|
+
@max = max
|
25
|
+
@valueWidth = Integer((value * @width) / @max)
|
25
26
|
baseConfig = {
|
26
27
|
"background" => "#eee",
|
27
28
|
"foreground" => "#999",
|
@@ -82,11 +83,11 @@ module PillChart
|
|
82
83
|
end
|
83
84
|
|
84
85
|
def drawStateForegroundPath
|
85
|
-
if @valueWidth < 20
|
86
|
+
if @valueWidth < ((20 * @max) / 100)
|
86
87
|
barColor = @config["low"]
|
87
|
-
elsif @valueWidth <
|
88
|
+
elsif @valueWidth < ((40 * @max) / 100)
|
88
89
|
barColor = @config["medium"]
|
89
|
-
elsif @valueWidth <
|
90
|
+
elsif @valueWidth < ((70 * @max) / 100)
|
90
91
|
barColor = @config["high"]
|
91
92
|
else
|
92
93
|
barColor = @config["full"]
|