maranda26
Posts: 6
Joined: Wed Sep 28, 2022 1:10 pm

Drilldown / Drillthrough to a separate HighChart

Hey there,

I’m relatively new to Highcharts and have been tasked with creating dynamic highcharts using data from a SQL database. I’m able to create some charts, but I’m trying to figure out how to properly create the drilldown/drillthrough feature. From what I’ve seen in examples, drilldown data is embedded in the Highcharts build right from the beginning. It also appears that the drilldown is of the same style as the parent, i.e. a pie chart drills down to another pie chart.

What I would like to be able to do is create a Highchart with summary data pulling from SQL, then if you click on a point in the highchart, it will call and load a secondary javascript function that will call the drill down SQL stored procedure using point data and parameters from the original chart and generate a brand new Highchart.

An example would be a stacked column chart showing overall sales by location. If you click on the one of the bar points, it would load a pie chart showing the products sold for that location and time. The overall sales by location data is pulled from one stored procedure and the Products sold is another stored procedure with date and location pulled from the parent highchart fed in as parameter values.

Any advice would be greatly appreciated.

Thank you
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: Drilldown / Drillthrough to a separate HighChart

Hi maranda26!
Welcome to our forum and thanks for contacting us with your question!

If you want to show another chart type after drilling down, all you need to add is a proper series type to drill down series. Just can see the drilldown event in the demo below.

Demo: https://jsfiddle.net/BlackLabel/3qtc6oah/
API Reference: https://www.highcharts.com/docs/chart-c ... /drilldown

Let me know if you have any further questions.
Regards!
Hubert Kozik
Highcharts Developer
maranda26
Posts: 6
Joined: Wed Sep 28, 2022 1:10 pm

Re: Drilldown / Drillthrough to a separate HighChart

Thanks Hubert.

I think this is a great starting point for me to look at. especially where you commented the make call to SQL db. That is going to be my key in this.

Thank you again.
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: Drilldown / Drillthrough to a separate HighChart

You're welcome! In case of any further questions, feel free to contact us again.
Hubert Kozik
Highcharts Developer

Return to “Highcharts Usage”