问题
I’m interested in integrating Highcharts into my Weebly page but am struggling to get it to work. I can get the “Cloud” version to display, but can’t get any of the JS based graphs to load.
I have included this in the Header section of the SEO setting:
<scriptsrc="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<scriptsrc="//code.highcharts.com/highcharts.js"></script>
<scriptsrc="//code.highcharts.com/modules/data.js"></script>?
And this is included in the Embed section on a normal page:
$(function () {
$('#container').highcharts({
chart: {
type: 'bar'
},
title: {
text: 'Fruit Consumption'
},
xAxis: {
categories: ['Apples', 'Bananas', 'Oranges']
},
yAxis: {
title: {
text: 'Fruit eaten'
}
},
series: [{
name: 'Jane',
data: [1, 0, 4]
}, {
name: 'John',
data: [5, 7, 3]
}],
});
});
That's an example from JSFiddle. When I publish the page all I get is the code in a box and no graph. Can anyone point me in the right direction please?
Thanks
回答1:
You have to add the entire link to the libraries:
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/data.js"></script>
Here a demo with the code you selected: https://junefirst.weebly.com/ the first demo is using Highchart cloud and the second is your demo
来源:https://stackoverflow.com/questions/39402156/integrating-highcharts-into-weebly