How to use the c3/c3.generate function in c3

To help you get started, we’ve selected a few c3 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 cockpit-project / cockpit / pkg / machines / c3charts.jsx View on Github external
_renderChart() {
        logDebug('DonutChart._render() called');
        const bindTo = `#${this.domId}`;
        const c3ChartDefaults = $().c3ChartDefaults();
        const options = c3ChartDefaults.getDefaultDonutConfig('');

        const props = this.prepareProps(this.props);

        options.bindto = bindTo;
        options.data = props.data;
        options.size = props.size;
        options.donut.width = props.width;
        options.tooltip = props.tooltipText ? { contents: $().pfGetUtilizationDonutTooltipContentsFn(props.tooltipText) } : options.tooltip;

        try {
            this.donutChart = c3.generate(options);
            $().pfSetDonutChartTitle(bindTo, props.primaryTitle, props.secondaryTitle);
        } catch (err) {
            logDebug('Exception thrown when rendering donut chart: ', err);
        }
    }

c3

D3-based reusable chart library

MIT
Latest version published 4 years ago

Package Health Score

66 / 100
Full package analysis