fix hovertime issue in tableGraphs
Co-authored-by: Deniz Kusefoglu <deniz@influxdata.com>pull/3030/head
parent
2716a59a62
commit
88ab26a385
|
@ -57,8 +57,6 @@ class TableGraph extends Component {
|
||||||
super(props)
|
super(props)
|
||||||
this.state = {
|
this.state = {
|
||||||
data: [[]],
|
data: [[]],
|
||||||
unzippedData: [[]],
|
|
||||||
filteredData: [[]],
|
|
||||||
processedData: [[]],
|
processedData: [[]],
|
||||||
hoveredColumnIndex: NULL_ARRAY_INDEX,
|
hoveredColumnIndex: NULL_ARRAY_INDEX,
|
||||||
hoveredRowIndex: NULL_ARRAY_INDEX,
|
hoveredRowIndex: NULL_ARRAY_INDEX,
|
||||||
|
@ -126,12 +124,16 @@ class TableGraph extends Component {
|
||||||
|
|
||||||
handleHover = (columnIndex, rowIndex) => () => {
|
handleHover = (columnIndex, rowIndex) => () => {
|
||||||
const {onSetHoverTime, tableOptions: {verticalTimeAxis}} = this.props
|
const {onSetHoverTime, tableOptions: {verticalTimeAxis}} = this.props
|
||||||
const data = verticalTimeAxis ? this.state.data : this.state.unzippedData
|
const {data} = this.state
|
||||||
|
if (rowIndex === 0) {
|
||||||
|
return
|
||||||
|
}
|
||||||
if (onSetHoverTime) {
|
if (onSetHoverTime) {
|
||||||
const hoverTime = verticalTimeAxis
|
const hoverTime = verticalTimeAxis
|
||||||
? data[rowIndex][0]
|
? data[rowIndex][0]
|
||||||
: data[0][columnIndex]
|
: data[columnIndex][0]
|
||||||
onSetHoverTime(hoverTime.toString())
|
onSetHoverTime(hoverTime.toString())
|
||||||
|
console.log(moment(hoverTime).format(this.props.tableOptions.timeFormat))
|
||||||
}
|
}
|
||||||
this.setState({
|
this.setState({
|
||||||
hoveredColumnIndex: columnIndex,
|
hoveredColumnIndex: columnIndex,
|
||||||
|
|
Loading…
Reference in New Issue