Store left in var

pull/10616/head
Andrew Watkins 2018-01-12 12:59:46 -08:00
parent ccc18d1da5
commit fd9dd2d7a4
1 changed files with 3 additions and 1 deletions

View File

@ -1,10 +1,12 @@
import React, {PropTypes} from 'react' import React, {PropTypes} from 'react'
const calcStyle = (annotation, dygraph) => { const calcStyle = (annotation, dygraph) => {
const left = `${dygraph.toDomXCoord(annotation.time)}px`
return { return {
left,
position: 'absolute', position: 'absolute',
top: '0px', top: '0px',
left: `${dygraph.toDomXCoord(annotation.time)}px`,
backgroundColor: '#f00', backgroundColor: '#f00',
height: '100%', height: '100%',
width: '2px', width: '2px',