Highcharts column Point Click

拥有回忆 提交于 2019-12-11 13:44:29

问题


Hello I have already asked a question on Highcharts Point Click not working. Further to that what I have found is my click function works in google chrome but not in IE 8. Can you please help me with this? I am not getting any responses on my earlier question hence I am posting this again -

Below is my code -

var columnoptions = {
                chart: {
                    renderTo: 'container',
                    type: 'column'
                },
                title: {
                    text: 'Exposure Details - Column Chart'
                },
                xAxis: {
                    categories: []
                },
                yAxis: {
                    title: {
                        text: 'Exposure'
                    }
                },              
                plotOptions: {  
            series: {
                cursor: 'pointer',
                point: {
                    events: {
                        click: function() {
                            alert ('here');
                        }
                    }
                }
            } 
        },
                series: []
            };   

and below is the function which draws column chart -

function displayColumnChart(){

     columnoptions.series = [];
     columnoptions.xAxis.categories = [];            
      var seriesOptions = {
                    name: 'chart',
                    data: [],                       

                };
     for(index = 0; index < categoryArray.length; index++){

         columnoptions.xAxis.categories.push(categoryArray[index]);

         seriesOptions.data.push(valueArray[index]);        

     }      

     columnoptions.series.push(seriesOptions); 
     chart = new Highcharts.Chart(columnoptions);
   }

Is it because the way I am dynamically creating this chart? Please guide me regarding this. I am getting error - Object doesnt support this property or method. Highcharts.js line 25. Code 0. Char 55. I wish to implement chart drill down. Hence need to get this working. And IE is standard browser in the company. Please help me.


回答1:


Object doesnt support this property or method

This is the Javascript error generated mostly in IE.

Always check for extra comma,single quote in your code when you encounter such JS error.

I can see such one in your code snippet.

var seriesOptions = {
                    name: 'chart',
                    data: [],                       

                };

This should be

var seriesOptions = {
                        name: 'chart',
                        data: []                       

                    };

Firefox ignores such error but IE does not let you go. :)




回答2:


I just used latest highcharts files 2.2.5 and that solved it. Works in IE8. And I feel overall performance is also improved..smooth. Thanks. :)



来源:https://stackoverflow.com/questions/11742284/highcharts-column-point-click

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