Highchart, How to export along with sub-topics Highcgarts Drilldown

Viewed 29

I have problem, when I export PDF or PNG file. It doesn't show the sub topic. I want to show sub topic when I click drilldown this link demo Link Demo and this when I export Picture when export But I want to export like this Picture export I want

1 Answers

You can update subtitle text for exporting, based on generated breadcrumbs. For example:

   chart: {
     ...,
     events: {
       redraw() {
         const breadcrumbs = this.breadcrumbs;
         breadcrumbsText = '';

         if (breadcrumbs) {
           breadcrumbs.list.forEach(list => {
             if (breadcrumbsText) {
               breadcrumbsText += ' / '
             }
             breadcrumbsText += list.levelOptions.name;
           });
         }
       },
       load() {
         if (this.renderer.forExport) {
           this.setSubtitle({
             text: breadcrumbsText
           });
           Highcharts.drawTable(this);
         }
       }
     },
   }

Live demo: http://jsfiddle.net/BlackLabel/ety8oak4/

API Reference: https://api.highcharts.com/class-reference/Highcharts.Chart#setSubtitle

Related