将Highcharts整合到Weebly中 [英] Integrating Highcharts into Weebly

查看:69
本文介绍了将Highcharts整合到Weebly中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有兴趣将Highcharts集成到我的Weebly页面中,但正在努力使其正常运行.我可以显示云"版本,但无法加载任何基于JS的图表.

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.

我已将其包含在SEO设置的标题"部分中:

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]
    }],
});
});

这是来自JSFiddle的示例.当我发布页面时,我得到的只是框中的代码,没有图形.有人可以指出我正确的方向吗?

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?

谢谢

推荐答案

您必须将整个链接添加到库中:

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>

这里有一个包含您选择的代码的演示: https://junefirst.weebly.com/ 第一个演示是使用Highchart云,第二个是您的演示

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

这篇关于将Highcharts整合到Weebly中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆