Support: StackOverflow

if else

by mustapha mekhatria

HTML

<script src="https://code.highcharts.com/highcharts.js"></script>

<div id="container" style="height: 400px; width: 500px"></div>

JavaScript

$(function() {

  $('#container').highcharts({


    xAxis: {
      categories: [1, 4, 0, 0, 2, 0, 5, 0],

      labels: {
        formatter: function() {
          // custom formatter
          debugger;
          if (this.value == 0) {
            return '(Not Designated)';

          } else if (this.value != 0) {

            return this.value;
          }
        },
      },
    },

    series: [{
      data: [29.9, 71.5, 106.4, 102, 80, 76, 45]
    }]
  });
});