JSFiddle API examples are broken

佐手、 提交于 2019-12-12 16:37:48

问题


From the API documentation in: http://api.highcharts.com/highcharts#chart.alignTicks

Clicking in align ticks true example: http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/chart/alignticks-true/

Doesn't render the chart. The following error appears in the JS console:

Uncaught TypeError: Object [object Object] has no method 'highcharts' 

回答1:


problem is .highchart. Use

var chart = new Highcharts.Chart({
    chart: {
        //alignTicks: false,
        type: 'line',
        renderTo: 'container'
    },
    ...
}

problem is HighCharts js file updates. In highcharts offical site demos are not working , too.

DEMO




回答2:


The .highcharts mechanism was introduced in Highcharts 3.0 via a JQuery plugin, as documented in the Highcharts 3.0 release announcement. Presumably the JSFiddle pages in question that weren't working were including an older version of Highcharts at the time, as I was until I figured why my own charts weren't working!




回答3:


I updated their jsfiddle chart.

It works now. The problem was with highcharts which didn't really existed as a method of the jQuery object.



来源:https://stackoverflow.com/questions/15248383/jsfiddle-api-examples-are-broken

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