From ee22eda43b10818bb3590c616f77ba24effa4895 Mon Sep 17 00:00:00 2001 From: zebibg Date: Fri, 1 Jul 2022 13:41:45 -0700 Subject: [PATCH] Hide overlapping x-axis values --- src/components/HomePage/DashBoard/Graph1.js | 13 ++++++------- src/components/HomePage/DashBoard/Graph2.js | 12 +++++------- .../HomePage/DashBoard/SettingsPopOver.js | 6 ++++-- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/components/HomePage/DashBoard/Graph1.js b/src/components/HomePage/DashBoard/Graph1.js index 160b26a..c2c5cfb 100644 --- a/src/components/HomePage/DashBoard/Graph1.js +++ b/src/components/HomePage/DashBoard/Graph1.js @@ -377,7 +377,8 @@ if ( graph==='totalTime'&&selection==='difficulty') { axisLabel: { formatter: (function(value){ return moment(value).format('MM/DD'); - }) + }), + hideOverlap: true } } , @@ -392,16 +393,14 @@ if ( graph==='totalTime'&&selection==='difficulty') { return ( {setSettingsVisible(false)}} onMouseEnter={()=>{setSettingsVisible(true)}}> {!settingsView? - {setSettingsVisible(true)}}> - + {setSettingsVisible(true)}}> + : } - {settingsVisible? - : - null - } + + ) } diff --git a/src/components/HomePage/DashBoard/Graph2.js b/src/components/HomePage/DashBoard/Graph2.js index 990e90f..c3bbc43 100644 --- a/src/components/HomePage/DashBoard/Graph2.js +++ b/src/components/HomePage/DashBoard/Graph2.js @@ -337,7 +337,8 @@ if ( graph==='totalTime'&&selection==='difficulty') { axisLabel: { formatter: (function(value){ return moment(value).format('MM/DD'); - }) + }), + hideOverlap: true } }, yAxis: { @@ -348,16 +349,13 @@ if ( graph==='totalTime'&&selection==='difficulty') { return ( {setSettingsVisible(false)}} onMouseEnter={()=>{setSettingsVisible(true)}}> {!settingsView? - {setSettingsVisible(true)}}> - + {setSettingsVisible(true)}}> + : } - {settingsVisible? - : - null - } + ) }; \ No newline at end of file diff --git a/src/components/HomePage/DashBoard/SettingsPopOver.js b/src/components/HomePage/DashBoard/SettingsPopOver.js index 505efd8..f79378f 100644 --- a/src/components/HomePage/DashBoard/SettingsPopOver.js +++ b/src/components/HomePage/DashBoard/SettingsPopOver.js @@ -3,11 +3,13 @@ import Stack from '@mui/material/Stack'; import IconButton from '@mui/material/IconButton'; import SettingsApplicationsIcon from '@mui/icons-material/SettingsApplications'; -export default function IconButtonSizes({setSettingsView, settingsView}) { +export default function IconButtonSizes({setSettingsView, settingsView, settingsVisible}) { + return ( {console.log(settingsView); setSettingsView(!settingsView)}}> - + + {settingsVisible? :} );