blacklabel / annotations

Annotations plugin for Highstock by Black Label
http://blacklabel.github.io/annotations/
Other
22 stars 16 forks source link

Uncaught ReferenceError: HighchartsAdapter is not defined #52

Closed ianliu0420 closed 8 years ago

ianliu0420 commented 8 years ago

The plugin was working. But these two days, I got this error even running a very basic demo. The detail of the error is:

Uncaught ReferenceError: HighchartsAdapter is not defined(anonymous function) @ annotations.js:1102

Here are the codes:

test.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

Insert title here

head

test.js

$(document).ready( function() {

        $('#container').highcharts(
                {
                    title : {
                        text : 'Monthly Average Temperature',
                        x : -20
                    // center
                    },
                    subtitle : {
                        text : 'Source: WorldClimate.com',
                        x : -20
                    },
                    xAxis : {
                        categories : [ 1,2,3,4,5,6,7,8,9,10,11,12 ]
                    },
                    yAxis : {
                        title : {
                            text : 'Temperature (°C)'
                        },
                        plotLines : [ {
                            value : 0,
                            width : 1,
                            color : '#808080'
                        } ]
                    },
                    tooltip : {
                        valueSuffix : '°C'
                    },
                    legend : {
                        layout : 'vertical',
                        align : 'right',
                        verticalAlign : 'middle',
                        borderWidth : 0
                    },
                    series : [
                            {
                                name : 'Tokyo',
                                data : [ 7.0, 6.9, 9.5, 14.5, 18.2, 21.5,
                                        25.2, 26.5, 23.3, 18.3, 13.9, 9.6 ]
                            },
                            ],
                    annotations : [ {
                        xValue : 4,
                        yValue : 20,
                        title : {
                            text : "Annotated chart!"
                        },
                        events : {
                        // click: function(e) { console.log("Annotation
                        // clicked:", this };
                        }
                    } ]
                });

    });
ianliu0420 commented 8 years ago

It seems that annotation.js has some conflicts with the latest highstock.js (version 2.1.10 http://code.highcharts.com/stock/2.1.10/highstock.js)

annotation.js works well with the previous version, say for example version 2.1.9 http://code.highcharts.com/stock/2.1.9/highstock.js