title: How to hide zero values in a chart with amchart.js?
body: <p>How to hide zero value in chart using amchart.js ?</p>
  
  <p><a href="https://i.stack.imgur.com/u9BLn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/u9BLn.png" alt="enter image description here"></a></p>
  
  <p>Here's my code to generate the chart :</p>
  
  <pre><code>function getStatsByFlowByOperation(){
      $.ajax({
          success: function(data) {
  
                  //data = formatData(data);
  
                  am4core.useTheme(am4themes_material);
                  chart = am4core.create("chartdiv", am4charts.XYChart);
                  chart.hiddenState.properties.opacity = 0;
                  chart.data = data;
                  chart.colors.step = 2;
                  chart.padding(30, 30, 10, 30);
                  chart.legend = new am4charts.Legend();
  
                  var categoryAxis = chart.xAxes.push(new am4charts.CategoryAxis());
                  categoryAxis.dataFields.category = "OPERATION_NAME";
                  categoryAxis.renderer.minGridDistance = 30;
                  categoryAxis.renderer.grid.template.location = 0;
                  categoryAxis.renderer.labels.template.rotation = 315;
                  categoryAxis.renderer.labels.template.verticalCenter = "middle";
                  categoryAxis.renderer.labels.template.horizontalCenter = "right";
  
                  var valueAxis = chart.yAxes.push(new am4charts.ValueAxis());
                  valueAxis.renderer.inside = true;
                  valueAxis.renderer.labels.template.disabled = true;
                  valueAxis.min = 0;
  
                  var allStatus = [];
                  allStatus.push("NEW");
                  allStatus.push("DISABLED");
                  allStatus.push("SKIPPED");
                  allStatus.push("READY");
  
                  for(var i = 0; i &lt; allStatus.length; i++) {
                      createSeries(allStatus[i], allStatus[i]);
                  }
          },
          error: function (jqXHR, exception) {
              if (globalVars.unloaded) {
                  return;
              }
              manageAjaxError(jqXHR, textStatus, errorThrown);
          }
      });
  }
  </code></pre>
  
  <p>This is an example of date in input:</p>
  
  <pre><code>[{
      "READY": 0,
      " ": 1,
      "OPERATION_NAME": "INIT",
      "STEP": 1
  }]
  </code></pre>
  
  <p><strong>EDIT -</strong></p>
  
  <p>Solution is to insert "null". It keeps columns displayed even if they display "0" value, e.i.:</p>
  
  <pre><code>if(data[i].READY == 0) {
      data[i].READY = null;
  }
  </code></pre>