How to use the g2.Stat.summary function in g2

To help you get started, we’ve selected a few g2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github 0xbug / SQLiScanner / public / src / components / Tasks / SqlInjectScan / Chart.js View on Github external
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'));
github ym2011 / PEST / SQLiScanner / public / src / components / Tasks / SqlInjectScan / Chart.js View on Github external
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'));

g2

An implementation of the Grammar of Graphics in javascript

MIT
Latest version published 7 years ago

Package Health Score

70 / 100
Full package analysis