diff --git a/src-trader-dashboard/components/TopMoversGrid.jsx b/src-trader-dashboard/components/TopMoversGrid.jsx index 49214ee..0ab18a3 100644 --- a/src-trader-dashboard/components/TopMoversGrid.jsx +++ b/src-trader-dashboard/components/TopMoversGrid.jsx @@ -34,7 +34,7 @@ class TopMoversGrid extends Component { cellRenderer: 'animateShowChange', cellClass: 'align-right', sort: 'desc', - cellFormatter(params) { + valueFormatter(params) { return params.value.toFixed(2) } }, diff --git a/src-trader-dashboard/components/renderers/HorizontalBarComponent.jsx b/src-trader-dashboard/components/renderers/HorizontalBarComponent.jsx index 5651ed3..5ee7161 100644 --- a/src-trader-dashboard/components/renderers/HorizontalBarComponent.jsx +++ b/src-trader-dashboard/components/renderers/HorizontalBarComponent.jsx @@ -3,6 +3,14 @@ import * as PropTypes from 'prop-types'; export default class HorizontalBarComponent extends Component { + constructor(props) { + super(props); + + this.state = { + value: this.props.value + } + } + render() { let positiveChange = { fill: "green" @@ -19,7 +27,7 @@ export default class HorizontalBarComponent extends Component { textAlign: "right" }; - let pctNetChange = this.props.value; + let pctNetChange = this.state.value; let pctNetChangeBar = Math.min(Math.abs(pctNetChange) * 100, 100) / 2; let barWidth = `${pctNetChangeBar}%`; @@ -36,6 +44,13 @@ export default class HorizontalBarComponent extends Component { ) } + + refresh(params) { + this.setState({ + value: params.value + }); + return true; + } } HorizontalBarComponent.propTypes = {