问题
I am reading a json file
http://www.megafileupload.com/dq4u/data.json
<html>
<head>
<script type='text/javascript' src='http://code.jquery.com/jquery-1.9.1.js'></script>
<script src="http://code.highcharts.com/stock/highstock.js"></script>
<script src="http://code.highcharts.com/stock/highchart.js"></script>
<script>
$(document).ready(function() {
var options = {
chart: {
renderTo: 'container',
type: 'heatmap'
},
title: {
text: 'pairwise LD'
},
xAxis: {
categories: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J']
},
yAxis: {
categories: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
title: null
},
colorAxis: {
min: 0,
minColor: '#FFFFFF',
maxColor: Highcharts.getOptions().colors[0]
},
legend: {
align: 'right',
layout: 'vertical',
margin: 0,
verticalAlign: 'top',
y: 25,
symbolHeight: 280
},
plotOptions:{
series:{
turboThreshold: 0
}
},
series: [{}]
};
$.getJSON('data.json', function(data) {
options.series[0].data = data;
var chart = new Highcharts.Chart(options);
});
});
</script>
</head>
<body>
<div id="container"></div>
</body>
</html>
But there is no output while when i paste the same values in the code i can see the output. Pls help me how can i fix this issue?
回答1:
In you chart you use heatmap which is not build-in highstock core, so you need add a reference to http://code.highcharts.com/modules/heatmap.js.
I advice you to run a console (https://developer.chrome.com/devtools/docs/console), where all errors are returned with description, then you avoid a problems like above.
来源:https://stackoverflow.com/questions/32229731/no-output-while-reading-json-file-in-highcharts