From 80715259b1af76e06fe59c1ba1d1e8ef556ecb20 Mon Sep 17 00:00:00 2001 From: Nikola Ubavic <53820106+ubavic@users.noreply.github.com> Date: Thu, 11 Aug 2022 20:19:59 +0200 Subject: [PATCH] feat: add y log scale --- .../src/pages/Analytics/Analytics.styles.js | 24 ++++++- .../components/wrappers/OverTimeWrapper.js | 11 ++- .../src/pages/Analytics/graphs/Graph.js | 4 +- .../Analytics/graphs/OverTimeDotGraph.js | 69 +++++++++++-------- 4 files changed, 75 insertions(+), 33 deletions(-) diff --git a/new-lamassu-admin/src/pages/Analytics/Analytics.styles.js b/new-lamassu-admin/src/pages/Analytics/Analytics.styles.js index 089547f8..8274d929 100644 --- a/new-lamassu-admin/src/pages/Analytics/Analytics.styles.js +++ b/new-lamassu-admin/src/pages/Analytics/Analytics.styles.js @@ -1,4 +1,14 @@ -import { offDarkColor, tomato, neon, java } from 'src/styling/variables' +import { + offColor, + offDarkColor, + tomato, + neon, + java +} from 'src/styling/variables' + +import typographyStyles from '../../components/typography/styles' + +const { label1 } = typographyStyles const styles = { overviewLegend: { @@ -135,6 +145,18 @@ const styles = { topMachinesRadio: { display: 'flex', flexDirection: 'row' + }, + graphHeaderSwitchBox: { + display: 'flex', + flexDirection: 'column', + '& > *': { + margin: 0 + }, + '& > :first-child': { + marginBottom: 2, + extend: label1, + color: offColor + } } } diff --git a/new-lamassu-admin/src/pages/Analytics/components/wrappers/OverTimeWrapper.js b/new-lamassu-admin/src/pages/Analytics/components/wrappers/OverTimeWrapper.js index 502d817a..def8fe90 100644 --- a/new-lamassu-admin/src/pages/Analytics/components/wrappers/OverTimeWrapper.js +++ b/new-lamassu-admin/src/pages/Analytics/components/wrappers/OverTimeWrapper.js @@ -1,8 +1,8 @@ import { Box } from '@material-ui/core' import { makeStyles } from '@material-ui/core/styles' -import React from 'react' +import React, { useState } from 'react' -import { Select } from 'src/components/inputs' +import { Select, Switch } from 'src/components/inputs' import { H2 } from 'src/components/typography' import { primaryColor } from 'src/styling/variables' @@ -25,6 +25,8 @@ const OverTimeDotGraphHeader = ({ }) => { const classes = useStyles() + const [logarithmic, setLogarithmic] = useState() + const legend = { cashIn:
, cashOut:
, @@ -57,6 +59,10 @@ const OverTimeDotGraphHeader = ({
+
+ Log. scale + setLogarithmic(event.target.checked)} /> +