Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_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);
}
}