title: Highcharts TypeScript, y-axis label
body: <p>Please refer to discussion <a href="https://stackoverflow.com/questions/4987457/highcharts-text-labels-for-y-axis">Highcharts text labels for y-axis</a> the way to setup y-axis label.</p>
  
  <p>I used <a href="https://github.com/borisyankov/DefinitelyTyped/blob/master/highcharts/highcharts.d.ts" rel="nofollow noreferrer">https://github.com/borisyankov/DefinitelyTyped/blob/master/highcharts/highcharts.d.ts</a> in my TypeScript definition, but I could not find a way to define y-axis formatter.</p>
  
  <p>Anybody ever tried before?</p>
  
  <p>-- <strong>Update</strong> --</p>
  
  <p>My origianl JavaScript code is </p>
  
  <pre><code>var yearChartOptions = {
      yAxis: {
          plotLines: [{
              label: {
                  formatter: function () {
                      return '$' + Highcharts.numberFormat(this.value/1000, 0) +'k ';
                  }
              },
          }]
      },
  };
  
  // Create the chart
  var yearChart = new Highcharts.Chart(yearChartOptions);
  </code></pre>
  
  <p>In the code I have a this.value which is each bar (I used bar chart) value. In TypeScript (I have not changed to remove array yet).</p>
  
  <pre><code>    var yearChartOptions: HighchartsOptions = {};
      yearChartOptions.chart = {};
      yearChartOptions.yAxis = [];
      yearChartOptions.yAxis[0] = {};
      yearChartOptions.yAxis[0].plotLines = {};
      yearChartOptions.yAxis[0].plotLines.label = {};
      yearChartOptions.yAxis[0].plotLines.label.style.formatter(() =&gt; "$" + Highcharts.numberFormat(this.value / 1000, 0) + "k ");
  
      // Create the chart
      var yearChart = new Highcharts.Chart(yearChartOptions);
  </code></pre>
  
  <p>The output is </p>
  
  <pre><code>/*
  Compile Error. 
  See error list for details
   D:/MyProject/Scripts/test.ts(36,56): The property 'formatter' does not exist on value of type 'HighchartsCSSObject'
  D:/MyProject/Scripts/test.ts(36,107): The property 'value' does not exist on value of type 'Dashboard'
  */
  </code></pre>
  
  <p>And it won't compile.</p>