Is there a way to disable Title and Subtitle in Highcharts?

I'm just going to rewrite it in the html that is around the graph, I don't want to use the built-in.

I do not see the "disable: true" option in the API.

Can anyone help me here.

How to disable caption / subtitles in tall charts?

(if you just leave the text blank, it still cuts out the space where the title is, I would like this to not happen)

+72
highcharts
Apr 10 '13 at 15:53
source share
10 answers

Setting header text to an empty string is a way to do this.

In this case, no space is created for the header:

without text: http://jsfiddle.net/jlbriggs/JVNjs/284/

with text: http://jsfiddle.net/jlbriggs/JVNjs/286/

title:{ text:'' } 

If you need less space than is left in this case, just set marginTop to 0

{{ edit due to numerous comments :

As indicated several times below, the documentation now states text: null as a way to achieve this.

Any method achieves the desired result.

+105
Apr 10 '13 at 16:05
source share

I prefer this method:

 title: { text: '', style: { display: 'none' } }, subtitle: { text: '', style: { display: 'none' } }, 
+35
Sep 25 '13 at 15:00
source share

From the highcharts document:

text: String The name of the chart. To disable the title, set the text to null. The default is the name of the chart.

script: http://jsfiddle.net/daub10dr/

 title:{ text: null } 
+30
Oct 13 '14 at 10:55
source share

It's simple ... Just set the title text to null. Like this

  $(function () { $('#container').highcharts({ xAxis: { categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] }, title: { text: null }, series: [{ data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4] }] }); 

});

see @APIreference: http://api.highcharts.com/highcharts#title.text

+12
Jul 25 '14 at 14:17
source share

Set the text field to null

From the documentation at http://api.highcharts.com/highcharts#title.text

text: String

The name of the chart. To disable the title, set the text to null. The default is the name of the chart.

+9
May 6 '14 at 16:06
source share

You can always do this:

 chart:{ marginTop: 30 } title:{ text: '' } 

This worked for me :-)

Note: this answer was for version 2.* , for newer versions there are better answers.

+8
Sep 15 '13 at 0:05
source share

According to the Highcharts document, the correct way is to set the "text" to null.

+7
Jul 01 '15 at 20:58
source share

Here is the solution

 title: { text: null }, subtitle: { text: null } 
+2
Jun 10 '14 at 5:03
source share

Just write a JSON object

 title : { style : { display : 'none' } } 
+2
Jun 30 '15 at 10:40
source share

This is a bit of a hack, but you can also try the following:

 title: { text: '<span class="hidden">My custom Hello</span>', align:"left", useHTML:true } 
-one
Mar 24 '14 at 4:06
source share



All Articles