score:0
$(function () {
// Create the chart
$('#container').highcharts({
chart: {
type: 'column',
events: {
drilldown: function (e) {
if (!e.seriesOptions) {
var chart = this,
drilldowns = {
'Animals': {
name: 'Animals',
data: [
['Cows', 2],
['Sheep', 3]
]
},
'Fruits': {
name: 'Fruits',
data: [
['Apples', 5],
['Oranges', 7],
['Bananas', 2]
]
},
'Cars': {
name: 'Cars',
data: [
{
name: 'Toyota',
y: 4,
drilldown: true
},
['Volkswagen', 2],
['Opel', 5]
]
}
},
series = drilldowns[e.point.name];
// Show the loading label
chart.showLoading('Simulating Ajax ...');
setTimeout(function () {
chart.hideLoading();
chart.addSeriesAsDrilldown(e.point, series);
}, 1000);
}
}
}
},
title: {
text: 'Async drilldown'
},
xAxis: {
type: 'category'
},
legend: {
enabled: false
},
plotOptions: {
series: {
borderWidth: 0,
dataLabels: {
enabled: true,
}
}
},
series: [{
name: 'Things',
colorByPoint: true,
data: [{
name: 'Animals',
y: 5,
drilldown: true
}, {
name: 'Fruits',
y: 2,
drilldown: true
}, {
name: 'Cars',
y: 4,
drilldown: true
}]
}],
drilldown: {
series: []
}
})
});
score:1
I found the solution to this. Actually when data is fetched from web service as json for the next level of drilldown I had to make sure the property drilldown needed to be set to true which I was not doing earlier after some research I found it. I have given some data in json format below with reference to the example on fiddle.
When first level was clicked I was going to web service and fetching data as
"{\"name\":\"Animals\",\"data\": [[\"Cows\", 2],[\"Sheep\", 3]],\"drilldown\": true}"
which was not enabling drilldown for the next level. In order to allow drill down further I had to modify the above data as below where in I have added property drilldown to be as true
(name == "Animals") resp = "{\"name\":\"Animals\",\"data\": [{\"name\":\"Cows\", \"y\": 2, \"drilldown\": \"true\"},{\"name\":\"Sheep\",\"y\": 3,\"drilldown\":\"true\"}]}";
That is all, seems simple :) Will try to create sample on Fiddle if I get time and will update link if done so.
Source: stackoverflow.com
Related Query
- How to fill dynamic json value in drill down highchart
- HighChart dynamic drill down
- Dynamic add series and categories for highchart drill down chart
- Fire click event on a highchart column drilldown chart on clicking x axis for drill down reports
- HighCharts : dynamic data with drill down
- how to remove scroll bar in drill down highchart
- Highchart Drill Down do not work for different chart types on same page
- Drill Down (Highcharts) not working with dynamic data in Angular
- highchart drill down break bar chart after change title
- Highchart grouped column with drill down
- How to make drill down in stacked Column Line chart in Highchart
- Highcharts - drill down to multiple series
- Drill Down (Highcharts) not working in Angular 5
- Highchart dynamic creation - not rendering properly
- Drill down function in highcharts in case of line charts
- Highcharts drill down - x-Axis labels loss on drillup
- Three level drill down highmap
- Add gridline on dynamic marker highchart
- Building dynamic number of arrays to display in Highchart
- Manually activate Drill down in Highcharts chart by clicking on another chart
- Highchart angular directive doesn't redraw from dynamic (ajax) data table
- how to change the point format for drill down in pie charts?
- HighChart Sparkline Chart with dynamic data for the table
- how to add dynamic xaxis category label name in new point highchart
- Synchronize two highcharts to drill down at once
- Angular 7 - Dynamic HighChart update
- how to add dynamic y axis in highchart from specific point of x-axis
- dynamic highchart config in angular ui grid with angular js using pablojim's highcharts ng
- Highcharts Line Chart Drill down not working properly
- HighCharts Drill Down multiple series , how to get drill down on second item on drill down?
More Query from same tag
- How to build a graph in a div that is still being rendered?
- javascript : how to link categories to date in highcharts
- Sort descendants data in categories in highcharts
- How to show time duration on y-axis in high chart
- Displaying Points And Drilldown Data in Highmaps
- Highstock chart doesn't show correct width in Phonegap app
- How can a text box be bound dynamically to the right border of a chart created with Highcharts?
- How to set tooltip border color from series in Highcharts
- Align scatter plot to right side in highcharts
- Issue on Fitting Highcharts.js in Bootstrap 3 Panels
- Highcharts: set regular intervals on xaxis
- Problems with retrieving mysql data into javascript in a specific format
- How to hide line but keep data labels in highcharts
- Highcharts if title contains number it shows invalid data
- highcharter convert value to percent in tooltip
- Pass function to jquery from php
- highcharts: how insert a fix label on a chart
- How to fix "Highcharts error #13" on live chart? when i'm already insert DOMContentLoaded
- Plotbands in the Highcharts .net wrapper do not show
- Dual Axes Column Chart scaling issue for column chart
- Javascript Highcharts v3.0.5 - How to hide Y Axis Title when using multiple Y Axis
- Flow chart in Highcharts adding list and line breaks
- legendItemClick not working in highMaps
- (Highcharts) Display Newest Data From Text File Only
- Prevent Highcharts to redraw Axis' scale
- Highcharts Date Time With Irregular Intervals Down to Minutes
- HighCharts Tooltips are coming but Graph is not coming
- Highcharts - null values are plotted on stacked area chart, in latest version
- plotbands target one of the two panes
- Sitecore 8 experience editor and jquery