问题
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