title: How to use Highchart formatter in rails?
body: <p>I want to represent the data through charts in my rails project for which I'm using Highcharts. I was able to integrate that into the project. I don't want to plot the graph if the y-axis value is zero. <a href="https://i.stack.imgur.com/GYZ5k.png" rel="nofollow noreferrer">Image reference of the current scenario</a></p>
  
  <p>My code,</p>
  
  <pre><code>@chart_data = [[2015, 20], [2016, 31], [2017, 5], [2018, 19], [2019, 0]]
  </code></pre>
  
  <pre><code>= column_chart @chart_data, height: '375px', library: {
    xAxis: {
      title: { text: 'Years'}
    },
    yAxis: {
      stackLabels: {
        enabled: true, style: {color: '#8b9196'}
      },
      title: {
        text: 'Turn over rate')
      }
    },
    plotOptions: {
      column: {
        dataLabels: {
          enabled: true, style: { color: 'white'}
        }
      }
    },
    legend: {
      align: 'right', x: 0, verticalAlign: 'top', y: -10, floating: true, backgroundColor: 'white', borderColor: '#CCC', borderWidth: 1, shadow: false
    }
  }
  </code></pre>
  
  <p>I'm finding the solutions in JavaScript format which are not useful. Based on the search following code should be added as follows</p>
  
  <pre><code>plotOptions: {
      column: {
        dataLabels: {
          enabled: true, style: { color: 'white'},
          formatter: %|function(){
            if (this.y &gt; 0)
              return this.y;
          }|
        }
      }
    }
  </code></pre>
  
  <p>It is throwing the error <a href="https://i.stack.imgur.com/42pHU.png" rel="nofollow noreferrer">refer to the image here</a>. I'm unable to figure out the way to get the desired result. I'm looking for help in rails because the chart is added in the view.</p>