Fix plot
This commit is contained in:
@@ -55,7 +55,7 @@ class MessageHistory extends React.Component<Props, State> {
|
||||
value: message.value,
|
||||
}))
|
||||
|
||||
const numericMessages = history.filter(message => !isNaN(message.value))
|
||||
const numericMessages = history.filter(message => !isNaN(parseFloat(message.value)))
|
||||
const showPlot = numericMessages.length >= 2
|
||||
|
||||
return (
|
||||
@@ -65,7 +65,7 @@ class MessageHistory extends React.Component<Props, State> {
|
||||
contentTypeIndicator={showPlot ? <BarChart /> : null}
|
||||
onClick={this.displayMessage}
|
||||
>
|
||||
{showPlot ? this.renderPlot(history) : null}
|
||||
{showPlot ? this.renderPlot(numericMessages) : null}
|
||||
</History>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -29,8 +29,8 @@ class PlotHistory extends React.Component<Props, Stats> {
|
||||
public render() {
|
||||
const data = this.props.messages.map((message) => {
|
||||
return {
|
||||
x: message.received,
|
||||
y: message.value,
|
||||
x: message.received.getTime(),
|
||||
y: parseFloat(message.value),
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user