title: How to convert highchart to binary image
body: <p>I'am using highchart for plotting a graph with angular:</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;highchart id="chart" class="plotchartCntr" config="chart"&gt;&lt;/highchart&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>$scope.chart = {
      options: {
          chart: {
              type: 'column'
          }
      },
      xAxis: {
          categories: [] // dynamically loaded after search
      },
      yAxis: {
          title: {
              text: 'Counts'
          },
          labels: {
              formatter: function() {
                  return this.value
              }
          }
      },
      tooltip: {
          crosshairs: true,
          shared: true
      },
      series: [] // dynamically loaded after search
  }
  </code></pre>
  
  <p>I have to save this as a image. </p>
  
  <p>My code (got from stack overflow):</p>
  
  <pre><code>var canvas = document.createElement("chart");
  canvas.width = 200;
  canvas.height = 500;
  var ctx = canvas.getContext("2d");
  ctx.drawImage(img, 0, 0);
  var dataURL = canvas.toDataURL("image/png");
  console.log(dataURL);
  </code></pre>
  
  <p>But I am getting error <code>canvas.getContext is not a function</code>.</p>
  
  <p>Please suggest</p>