How to set border for a highcharts pie? -


i want set border pie,but when there no data pie become thisenter image description here

how realize it?

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

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -