组合>高级时间轴导致" ReferenceError:未定义Highcharts"

时间:2015-11-27 15:42:40

标签: javascript highcharts

要复制的步骤

  1. http://www.highcharts.com/download
  2. 下载HIGHCHARTS 4.1.9
  3. 打开index.html
  4. 点击Combinations > Advanced timeline
  5. Firebug中显示以下错误,并且不显示任何图表:
  6. ReferenceError: Highcharts is not defined /Highcharts-4.1.9/js/modules/exporting.js Line 24

    ReferenceError: Highcharts is not defined /Highcharts-4.1.9/examples/combo-timeline/index.htm Line 280

    我尝试过的事情

    我更改了脚本路径:

    /Highcharts-4.1.9/examples/combo-timeline/index.html
    

    自:

    <script src="../../js/highstock.js"></script>
    <script src="../../js/modules/exporting.js"></script>
    

    要:

    <script src="../js/highstock.js"></script>
    <script src="../js/modules/exporting.js"></script>
    

    然而,这仍然会产生错误:

    ReferenceError: Highcharts is not defined
    /Highcharts-4.1.9/examples/combo-timeline/index.htm
    Line 280
    

    我在/combo-timeline/index.htm中更改了对jQuery的引用:

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
    

    为:

    <script type="text/javascript" src="../js/jquery-1.11.3.js"></script>
    

    然后产生此错误:

    ReferenceError: $ is not defined
    /Highcharts-4.1.9/examples/combo-timeline/index.htm
    Line 204
    

1 个答案:

答案 0 :(得分:1)

<强>解决方案

JSFiddle demo正在运行,所以我下载了以下内容:

https://code.highcharts.com/stock/highstock.js
https://code.highcharts.com/modules/exporting.js

并使用了小提琴中使用的jQuery版本:

jQuery Core 1.9.1

现在加载图表并且没有错误。