Issue with HighChart's StockChart. Getting highcharts is not a function

核能气质少年 提交于 2019-12-25 05:34:25

问题


So I have two doubts:

Q1:

I am unable to understand the difference between the two ways to initialize a High Chart:

1st way:

var lineChart = new Highcharts.Chart(
  {
    chart: {
        alignTicks: true,
        type : 'StockChart',
        renderTo : 'container',
...

2nd way:

    $('#container').highcharts('StockChart', {
        chart: {
            alignTicks: true,
            type : 'StockChart',
            renderTo : 'container',
...

Q2:

When Using the 2nd way on http://jsfiddle.net/ezk2mg72/ I am able to get desired result but when trying in local I am getting following exception:

**Uncaught TypeError: $(...).highcharts is not a function**

PS: the order of js files is correct as per different posts of stackoverflow suggested:

(I have scripts in local)
<script type="text/javascript" src="js/jquery-latest.js"></script>
<script type="text/javascript" src="js/highstock.js"></script>
<script type="text/javascript" src="js/exporting.js"></script>

http://jsfiddle.net/ezk2mg72/


回答1:


Loot at the error number before this error Uncaught TypeError and click to the link on your console to view the problem detail :

Uncaught Error: Highcharts error #16: www.highcharts.com/errors/16

And Good luck !



来源:https://stackoverflow.com/questions/30788873/issue-with-highcharts-stockchart-getting-highcharts-is-not-a-function

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!