Improving Vincent's Response. This is how I used it for simple text headers.
extendHighcharts = function(){ Highcharts.wrap(Highcharts.seriesTypes.pie.prototype, 'render', function (proceed) { //Clear the title if added previously //if your chart data does not change, this reference storage for removal can be left out if(this.chart.subChartTitleElement){ this.chart.subChartTitleElement[this.id].destroy(); } proceed.call(this); if (this.center && this.options.title) { //first, add the title, at center or anywhere, we need the container width to center it this.chart.subChartTitleElement[this.id] = this.chart.renderer.text(this.options.title.text,this.center[0],this.center[1]); this.chart.subChartTitleElement[this.id].css(this.options.title.style) this.chart.subChartTitleElement[this.id].add(); //Center the title using the container(Bounding Box = BBox) width var xCenter = this.chart.plotLeft + this.center[0] - (this.chart.subChartTitleElement[this.id].getBBox().width/2), yCenter = this.chart.plotTop + this.center[1] - 0.6 * this.center[2]; this.chart.subChartTitleElement[this.id].attr( { x:xCenter, y:yCenter } ); } }); }
USING
this.chart.addSeries({ type: 'pie', name: 'pie_chart_1', data: pieChartData, center: ['80%','25%'], size: '35%', showInLegend: false, dataLabels: { enabled: false }, //this part adds the relevant information title: { text:'Pie Chart Title', verticalAlign: 'top', y: -40 }, id:'a_unique_id_or_name' });
source share