highcharts Highchart,如何导出沿着子主题Highcgarts Drilldown

35g0bw71  于 2022-11-11  发布在  Highcharts
关注(0)|答案(1)|浏览(125)

当我导出PDF或PNG文件时,我遇到问题。它不显示子主题。我想在单击深入查看此链接时显示子主题,当我导出Picture when export时,演示Link Demo和此,但我想这样导出Picture export I want

qkf9rpyu

qkf9rpyu1#

您可以根据产生的轨迹更新要汇出的副标题文字。例如:

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);
         }
       }
     },
   }

现场演示:http://jsfiddle.net/BlackLabel/ety8oak4/
**API参考:**https:api.highcharts.com/class-reference/Highcharts.Chart#setSubtitle

相关问题