From 59fda29894bf58110ea2e0bca4dc3798542645e8 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Thu, 7 May 2020 11:06:14 +0200 Subject: [PATCH] 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, }, ],