use the range appropriately

This commit is contained in:
byte[] 2020-01-05 13:05:39 -05:00
parent af97bd1717
commit 816e54fa12

View file

@ -17,7 +17,7 @@ defmodule PhilomenaWeb.StatView do
content_tag :svg, class: "upload-stats", viewBox: "0 0 #{graph_width} #{graph_height}" do content_tag :svg, class: "upload-stats", viewBox: "0 0 #{graph_width} #{graph_height}" do
for {datum, i} <- Enum.with_index(data) do for {datum, i} <- Enum.with_index(data) do
bar_height = safe_div(datum["doc_count"], max_docs) * graph_height bar_height = safe_div(datum["doc_count"], max_docs - min_docs) * graph_height
x = i * bar_width x = i * bar_width
y = graph_height-bar_height y = graph_height-bar_height