Set time marker when user clicks bar in histogram
Co-authored-by: Alex Paxton <thealexpaxton@gmail.com> Co-authored-by: Daniel Campbell <metalwhirlwind@gmail.com>pull/3897/head
parent
d94fa96fc7
commit
e7eb8293a7
|
@ -326,6 +326,7 @@ class LogsPage extends Component<Props, State> {
|
|||
height={height}
|
||||
colorScale={colorForSeverity}
|
||||
colors={histogramColors}
|
||||
onBarClick={this.handleBarClick}
|
||||
/>
|
||||
)}
|
||||
</AutoSizer>
|
||||
|
@ -396,6 +397,19 @@ class LogsPage extends Component<Props, State> {
|
|||
this.props.executeQueriesAsync()
|
||||
}
|
||||
|
||||
private handleBarClick = (group: BarGroup): void => {
|
||||
const {data} = group
|
||||
|
||||
if (!data.length) {
|
||||
return
|
||||
}
|
||||
|
||||
const unixTimestamp = data[0].time
|
||||
const timeOption = moment(unixTimestamp).toISOString()
|
||||
|
||||
this.handleSetTimeMarker({timeOption})
|
||||
}
|
||||
|
||||
private handleSetTimeBounds = async () => {
|
||||
const {seconds, windowOption, timeOption} = this.props.timeRange
|
||||
let lower = `now() - ${windowOption}`
|
||||
|
|
Loading…
Reference in New Issue