Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
changeHandler() {
const {chart} = this.refs.myChart;
chart.clear();
chart.intervalStack().position(Stat.summary.percent('value')).color('name').label('name*..percent', function (name, percent) {
percent = (percent * 100).toFixed(2) + '%';
return name + ' ' + percent;
});
chart.render();
chart.on('plotclick', ev=> {
this.setState({loading: true});
let point = ev.data;
if (point) {
let scale = chart.getScale('name');
let host = scale.values[point.name];
this.setState({
target: this.props.filter + host,
loading: false
});
ReactDOM.unmountComponentAtNode(document.getElementById('filterResult'));
changeHandler() {
const {chart} = this.refs.myChart;
chart.clear();
chart.intervalStack().position(Stat.summary.percent('value')).color('name').label('name*..percent', function (name, percent) {
percent = (percent * 100).toFixed(2) + '%';
return name + ' ' + percent;
});
chart.render();
chart.on('plotclick', ev=> {
this.setState({loading: true});
let point = ev.data;
if (point) {
let scale = chart.getScale('name');
let host = scale.values[point.name];
this.setState({
target: this.props.filter + host,
loading: false
});
ReactDOM.unmountComponentAtNode(document.getElementById('filterResult'));