When there is insufficient data to display gauge graph, change title of

graph to insufficient Data
pull/1/head
rebuilt 4 years ago
parent d850674ff1
commit 722947d938

@ -92,7 +92,7 @@
fill: $white; fill: $white;
} }
.harvey-ball--no_zone { .harvey-ball--insufficient_data {
stroke: $gray-2; stroke: $gray-2;
fill: $gray-3; fill: $gray-3;
} }

@ -39,8 +39,11 @@
} }
.gauge-title { .gauge-title {
margin-top: -1.5em; line-height: 1.2;
margin-bottom: 0; max-width: 10ch;
text-align: center;
bottom: 0;
position: absolute;
} }
.measure-section { .measure-section {

@ -5,7 +5,7 @@ class GaugePresenter
end end
def title def title
zone.type.to_s.capitalize zone.type.to_s.titleize
end end
def color_class def color_class

@ -29,8 +29,8 @@ class Scale
Zone.new(@ideal_low_benchmark, 5.0, :ideal) Zone.new(@ideal_low_benchmark, 5.0, :ideal)
end end
def no_zone def insufficient_data
Zone.new(0,@warning_low_benchmark,:no_zone) Zone.new(0,@warning_low_benchmark,:insufficient_data)
end end
def zone_for_score(score) def zone_for_score(score)
@ -46,7 +46,7 @@ class Scale
when 1..warning_zone.high_benchmark when 1..warning_zone.high_benchmark
warning_zone warning_zone
else else
no_zone insufficient_data
end end
end end
end end

@ -14,7 +14,7 @@ class SubcategoryCardPresenter
growth: "half-circle", growth: "half-circle",
watch: "one-quarter-circle", watch: "one-quarter-circle",
warning: "full-circle", warning: "full-circle",
no_zone: "full-circle" insufficient_data: "full-circle"
} }
icons_by_zone_type[zone.type] icons_by_zone_type[zone.type]
end end
@ -24,7 +24,7 @@ class SubcategoryCardPresenter
end end
def insufficient_data? def insufficient_data?
zone.type == :no_zone zone.type == :insufficient_data
end end
private private

@ -43,7 +43,7 @@ class VarianceChartRowPresenter
bar_width_percentage bar_width_percentage
when :warning, :watch, :growth when :warning, :watch, :growth
-bar_width_percentage -bar_width_percentage
when :no_zone when :insufficient_data
-100 -100
end end
end end

@ -1,4 +1,4 @@
<div class="d-flex flex-column align-items-center"> <div class="d-flex flex-column align-items-center position-relative">
<svg <svg
viewBox="<%= viewbox.x %> <%= viewbox.y %> <%= viewbox.width %> <%= viewbox.height %>" viewBox="<%= viewbox.x %> <%= viewbox.y %> <%= viewbox.width %> <%= viewbox.height %>"
class="<%= gauge_class %>" class="<%= gauge_class %>"
@ -46,5 +46,5 @@
/> />
</svg> </svg>
<p class="gauge-title <%= font_class %> fill-black"><%= gauge.title %></p> <span class="gauge-title <%= font_class %> fill-black"><%= gauge.title %></span>
</div> </div>

Loading…
Cancel
Save