Show 0% change on the small plot (#3478)

* Show 0% change on the small plot

* Fix more cut-off

* ws
This commit is contained in:
hq1 2023-11-02 14:09:11 +01:00 committed by GitHub
parent 6148f4ad61
commit 30b4dc2872
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -38,7 +38,7 @@ defmodule PlausibleWeb.Live.Components.Visitors do
|> assign(:id, Ecto.UUID.generate())
~H"""
<svg viewBox={"0 -1 #{(@points_len - 1) * @tick} #{@height + 2}"} class="chart w-full mb-2">
<svg viewBox={"0 -1 #{(@points_len - 1) * @tick} #{@height + 3}"} class="chart w-full mb-2">
<defs>
<clipPath id={"gradient-cut-off-#{@id}"}>
<polyline points={@clip_points} />

View File

@ -258,7 +258,8 @@ defmodule PlausibleWeb.Live.Sites do
def percentage_change(assigns) do
~H"""
<p :if={@change != 0} class="dark:text-gray-100">
<p class="dark:text-gray-100">
<span :if={@change == 0} class="font-semibold text-green-500"></span>
<span :if={@change > 0} class="font-semibold text-green-500"></span>
<span :if={@change < 0} class="font-semibold text-red-400"></span>
<%= abs(@change) %>%