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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ff53e9a4fdf5e64b598c496c508b36d0244623ff
4
- data.tar.gz: c4e1da88510ff654b8849e056dbc5c67a607a882
3
+ metadata.gz: e6caa8f5bc8e610ff73f24218f4341b367dc6660
4
+ data.tar.gz: 7629915095214c95ea439242f5a884966914ca32
5
5
  SHA512:
6
- metadata.gz: 86e652bde2be5c0c1c7e6c28d2c25b1ab1e52f2c1d3d63eab8992a031e6a6ef45d9c318a0a10926bb860a0baf783d43afe886ea2d02c414054239f832a00fea9
7
- data.tar.gz: 21fa4f7a0cc505e278ca50dc59c591f07b4c16f9794ea4a2cd7692d927ab70a2377443261135a21ed33e8bb4cf4e90d9f45af3f689eb5b93ca732e73d619edf0
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
- @valueWidth = Integer((value * @width) / 100)
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 < 50
88
+ elsif @valueWidth < ((40 * @max) / 100)
88
89
  barColor = @config["medium"]
89
- elsif @valueWidth < 80
90
+ elsif @valueWidth < ((70 * @max) / 100)
90
91
  barColor = @config["high"]
91
92
  else
92
93
  barColor = @config["full"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pill_chart
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - André Aubin