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