Position stat tooltip on top of bar

This commit is contained in:
Nicholas Zuber 2018-11-17 17:16:56 -05:00
parent 43864a266d
commit cb03dc5c34
2 changed files with 4 additions and 3 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 405 KiB

After

Width:  |  Height:  |  Size: 406 KiB

View File

@ -518,7 +518,6 @@ const BarContainer = styled('div')({
const stripe_size = 3; const stripe_size = 3;
const Bar = styled('div')({ const Bar = styled('div')({
cursor: 'pointer',
position: 'relative', position: 'relative',
width: 20, width: 20,
minHeight: 5, minHeight: 5,
@ -790,12 +789,14 @@ export default function Scene ({
</BarContainer> </BarContainer>
{/* Wrapper for tooltips */} {/* Wrapper for tooltips */}
<BarContainer opacity={0}> <BarContainer opacity={0}>
{lastWeekStats.map((_, i) => ( {thisWeekStats.map((dayStats, i) => (
<EnhancedBar <EnhancedBar
key={i} key={i}
style={{width: 33}} style={{width: 33}}
tooltip={getWeekday(i)} tooltip={getWeekday(i)}
tooltipOffsetY={-15} tooltipOffsetY={
(Math.max((dayStats / highestStagedCount) * 100, 5) * -1) + 85
}
tooltipOffsetX={5} tooltipOffsetX={5}
tooltipSpeed={0} tooltipSpeed={0}
height={100} height={100}