0

I have a highcharts drilldown column chart that shows weekly spending, and users can drill down in each week to see the category breakdown. Separate to the chart, users can also filter down the categories they want to see and we then pull the filtered down chart data and update both top and drilled down levels using the following snippet:

chart.update({
     series: {data: updated_series_data},
     drilldown: {series: updated_drilldown_data}
}, true, false, false);

This updates the data behind the chart fine, but behaves strange when it is run while the chart is already drilled down. By strange I mean the chart appears to remain drilled down and show the "back to weekly spending" button, but displays top-level data

let's say the user is drilled down and sees the below: enter image description here Then the user wants to filter out the groceries bar, we then go and pull the chart data filtered for that week and excluding groceries and update the chart. But running the snippet above then shows the top level data bar without drilling back up like so:

enter image description here Is there a way to keep the chart drilled down and just update the viewed drilled down dataset? I tried only updating the "drilldown" element of the chart options, but that just turns the chart blank

Community
  • 1
  • 1
user1960089
  • 167
  • 1
  • 1
  • 10
  • It is a bug and it was already reported on Highcharts Github here: https://github.com/highcharts/highcharts/issues/8839. Current workaround: Do not call the update before going back to the top level in a chart that was drilled down. – Wojciech Chmiel Dec 28 '18 at 06:54
  • Thanks for highlighting that. So is there a way to call drillUp() to go back to the top level, without triggering the callback event? Currently, I have a callback function that was designed for when a user clicks the "back to weekly spending" button, but I don't want to run the exact same function when drilling up just for the purpose of updating the chart data. – user1960089 Jan 09 '19 at 04:54
  • Unfortunately, there isn't a way to call `drillUp()` method without triggering the callback event. However, you can overwrite `Highcharts.Chart.prototype.showDrillUpButton` method and invoke the function you have in the drillup callback when drillUpButton is clicked. Check this sample demo: https://jsfiddle.net/BlackLabel/0gv5xs9u/. – Wojciech Chmiel Jan 09 '19 at 10:53

0 Answers0