How to set border for a highcharts pie? -
you can catch load event, check series.data length , if empty, use renderer add empty circle.
chart: { plotbackgroundcolor: null, plotborderwidth: null, plotshadow: false, type: 'pie', events:{ load: function() { var chart = this, series = chart.series[0], center = series.center; if(series.data.length === 0) { chart.renderer.circle(center[0],center[1],100) .attr({ fill:'rgba(0,0,0,0)', stroke: 'red', 'stroke-width': 1 }) .add(); } } } },
example:
Comments
Post a Comment