Just recently, I posted a query regarding Highcharts column charts drilldown. I have discovered that within the click event of the point object, you can determine which column was clicked. I have integrated this functionality into my code, but unfortunately, I am not seeing the alert that I expected. Below is a snippet of my code. First off, here are my chart options:
var columnoptions = {
chart: {
renderTo: 'container',
type: 'column'
},
title: {
text: 'Column Chart'
},
xAxis: {
categories: []
},
yAxis: {
title: {
text: 'Exposure'
}
},
plotOptions: {
series: {
cursor: 'pointer',
point: {
events: {
click: function() {
alert ('here');
}
}
}
}
},
series: []
};
I am populating the series dynamically with the following statements in a loop:
columnoptions.xAxis.categories.push(categoryArray[index]);
seriesOptions.data.push(valueArray[index]);
Lastly, I display my chart in the following manner:
chart = new Highcharts.Chart(columnoptions);
Despite all this, I am not receiving any alerts upon clicking on a column. Additionally, I am encountering JavaScript error messages in IE. I am using IE8. I would greatly appreciate any assistance with this issue. The official Highcharts example with static data works perfectly fine, and I have verified that my chart displays correctly without any problems. However, I am eager to identify which column was clicked in order to implement the drilldown functionality. Please lend me a hand.
---Edit Here is the complete function I am utilizing to draw the charts-
function displayColumnChart(){
columnoptions.series = [];
columnoptions.xAxis.categories = [];
var seriesOptions = {
name: 'Column Chart',
data: [],
};
/* The category array contains x-axis category values
The value array contains y-axis numeric values */
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);
}
I am reading my data from an XML document and then generating the value and category arrays. The chart renders correctly, but I am not receiving the alert upon clicking a point. Any assistance would be greatly appreciated. Thank you for your help. :) Apologies for the delay in posting the code.