Home forums Using CanvasJS What if, all y : data is 0 ? Reply To: What if, all y : data is 0 ?

#18586

nik.sol
Member

Did some more changes..

Using this :

if(isEmpty){
  <strong> for(var i = 0; i < dataPoints.length; i++){
      dataPoints[i].indexLabel = '';
   }</strong>
   chart.options.subtitles.push({
     text : text,
     verticalAlign : 'center',
   });
}

Instead of :

if(!isEmpty){
   	for(var i = 0; i < dataPoints.length; i++){
      isEmpty = !dataPoints[i].y;
     <del datetime="2018-01-03T09:35:27+00:00"> dataPoints[i].indexLabel = '';</del>
    	if(!isEmpty)
        break;
    }
   }

nik.sol