Malarivtan
Malarivtan

Reputation: 414

Highchart drilldown subtitle change

How can I change the subtitle and not the title?

series: {
              cursor: 'pointer',
              point: {
                events: {
                 click: function() {//alert ('Category: '+ this.category +', value: '+ this.y);

                     var drilldown = this.drilldown;
                     if (drilldown) { // drill down

                         this.series.chart.setTitle({
                             text: drilldown.name 
                         });                     

                     } else { // restore

                     }
                 }
                }
              }
           }
        },

will it be like:

this.series.chart.setSubTitle({
                                 text: 'vlabla'
                          });

I tried it with the above it doesn't work

Please help anyone?

Upvotes: 2

Views: 1283

Answers (1)

Kacper Madej
Kacper Madej

Reputation: 7886

There are drilldown and drillup events of chart that could be used to call chart.setTitle(). To set only subtitle and leave a title unchanged you could set title options object to null:

      chart.setTitle(null, {
        text: "after drilldown subtitle" //subtitle options
      });

Example: http://jsfiddle.net/axdcLmfx/

Upvotes: 2

Related Questions