Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This seems to do the trick. Thank you to Speransky Danil for struggling along with me - much appreciated.</p> <pre><code> var datas; datas = getData(); createChart(datas); function createChart(data){ var options = { chart: { renderTo: 'container' }, title: { text: 'Account Managers Leaderboard' }, xAxis: { categories: ['Month on Month', 'Day on Day'] }, tooltip: { formatter: function() { var s; if (this.point.name) { // the pie chart s = ''+ this.point.name +': '+ this.y +' sales'; } else { s = ''+ this.x +': '+ this.y; } return s; } }, labels: { items: [{ html: 'Total proportion of sales &lt;br /&gt;this month', style: { left: '40px', top: '-5px', color: 'black' } }] }, series: [{ type: 'pie', name: 'Total consumption', data: [{ name: 'Jane', y: 13 //color: '#4572A7' // Jane's color }, { name: 'John', y: 23 //color: '#AA4643' // John's color }, { name: 'Joe', y: 19 //color: '#89A54E' // Joe's color }], center: [30, 80], size: 100, showInLegend: false, dataLabels: { enabled: false } }] }; for(var i =0;i &lt;= data.length-1;i++) { var item = data[i]; options.series.push({ "type": "column", "name": item.name, "data": [item.data] }); } $(document).ready(function() { var chart; chart = new Highcharts.Chart(options); }); } function getData(){ //alert('ajax'); var receivedData; // store your value here $.ajax({ type: "GET", dataType: "json", url: "http://a-website.com/apiv1/summery/get/authKey/1/range/day/", async: false, success: function(data){ alert('data'+data); //works receivedData = data; } }); return receivedData; }; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload