title: Highcharts - set yAxis.max to max value from data
body: <p>I'm using Highcharts and I have this simple bar chart:</p>
  
  <p><a href="https://i.stack.imgur.com/c0oUH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/c0oUH.png" alt="my current chart"></a></p>
  
  <p>Max value in data is 27, but on the scale it's 40. How can i set yAxis.max to max value from the provided data? In this example 27 instead of 40.</p>
  
  <p>To be honest I don't even need those values on chart, but I want to force a bar with biggest value to occupy 100% of available height.</p>
  
  <p>The data will be provided dynamically, so I can't just set max value manually.</p>
  
  <p>Here is my current code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>Highcharts.chart('container', {
  
    chart: {
      type: 'column',
      height: 150,
    },
  
    yAxis: {
      title: {
        text: null,
      },
      labels: {
        enabled: true,
      },
    },
  
    xAxis: {
      title: {
        text: null,
      },
    },
  
    credits: false,
  
    legend: false,
  
    title: {
      text: null,
    },
  
    series: [{
      data: [1, 0, 27, 7]
    }]
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>#container {
    min-width: 310px;
    max-width: 800px;
    height: 400px;
    margin: 0 auto
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://code.highcharts.com/highcharts.js"&gt;&lt;/script&gt;
  &lt;script src="https://code.highcharts.com/modules/series-label.js"&gt;&lt;/script&gt;
  &lt;script src="https://code.highcharts.com/modules/exporting.js"&gt;&lt;/script&gt;
  
  &lt;div id="container"&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Here is jsfiddle: <a href="http://jsfiddle.net/de3qfb3r/" rel="nofollow noreferrer">http://jsfiddle.net/de3qfb3r/</a></p>