From 59fda29894bf58110ea2e0bca4dc3798542645e8 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Thu, 7 May 2020 11:06:14 +0200 Subject: [PATCH 1/2] Added precision 0 to charts, to avoid having decimals --- package-lock.json | 3 +-- src/visits/GraphCard.js | 2 +- test/visits/GraphCard.test.js | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index b13d0843..a0521c80 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,8 +1,7 @@ { "name": "shlink-web-client", - "version": "2.3.0", - "lockfileVersion": 1, "requires": true, + "lockfileVersion": 1, "dependencies": { "@babel/code-frame": { "version": "7.0.0", diff --git a/src/visits/GraphCard.js b/src/visits/GraphCard.js index f42b3184..b05c25c1 100644 --- a/src/visits/GraphCard.js +++ b/src/visits/GraphCard.js @@ -79,7 +79,7 @@ const renderGraph = (title, isBarChart, stats, max, highlightedStats, onClick) = scales: isBarChart && { xAxes: [ { - ticks: { beginAtZero: true, max }, + ticks: { beginAtZero: true, precision: 0, max }, stacked: true, }, ], diff --git a/test/visits/GraphCard.test.js b/test/visits/GraphCard.test.js index 278dd799..e924c699 100644 --- a/test/visits/GraphCard.test.js +++ b/test/visits/GraphCard.test.js @@ -64,7 +64,7 @@ describe('', () => { expect(scales).toEqual({ xAxes: [ { - ticks: { beginAtZero: true }, + ticks: { beginAtZero: true, precision: 0 }, stacked: true, }, ], From 665d6209d902d4710dbc6ede0b719813467ffd02 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Thu, 7 May 2020 11:10:10 +0200 Subject: [PATCH 2/2] Updated changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0adcc7f1..901b8b81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,7 +32,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), #### Fixed -* *Nothing* +* [#262](https://github.com/shlinkio/shlink-web-client/issues/262) Fixed charts displaying decimal numbers, when visits are absolute and that makes no sense. ## 2.4.0 - 2020-04-10