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

Highcharts

Highcharts Problem Overview


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

I don't see a "disable: true" option in the API.

Can anybody help me out here.

How do you disable the title / subtitle in highcharts?

(if you simply leave the text blank it still carves out a whitespace in that spot where the title is, i'd like to not have this happen)

Highcharts Solutions


Solution 1 - Highcharts

Setting the title text to an empty string is the way to do it.

No space is created for the title in that case:

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

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

title:{
    text:''
}

If you want less space than is left in that case, simply set your 'marginTop' to 0

{{edit due to numerous comments:

As pointed out a number of times below, the documentation now states text: null as the method to achieve this.

Either method achieves the desired result.

Solution 2 - Highcharts

From the highcharts doc: > text: String The title of the chart. To disable the title, set the text to null. Defaults to Chart title.

fiddle: http://jsfiddle.net/daub10dr/

title:{
      text: null
      }

Solution 3 - Highcharts

I prefer this method :

title: {
    text: '',
    style: {
        display: 'none'
    }
},
subtitle: {
    text: '',
    style: {
        display: 'none'
    }
},

Solution 4 - Highcharts

Very simple! In the latest version of Highcharts just set title and subtitle properties to false.

{
title: false,
subtitle: false
}

Find the working fiddle here: https://jsfiddle.net/samuellawrentz/hkqnvm7k/4/

Solution 5 - Highcharts

You can always do this:

chart:{
    marginTop: 30
}

title:{
    text: ''
}

That worked for me :-)

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

Solution 6 - Highcharts

It´s simple... Only set the title´s 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

Solution 7 - Highcharts

Set the text field to null

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

>text: String > >The title of the chart. To disable the title, set the text to null. Defaults to Chart title.

Solution 8 - Highcharts

According the Highcharts doc, the correct way is to set 'text' to null.

Solution 9 - Highcharts

In react-native below code worked for me,

  title: {
    style : {
      display : 'none'
    }
 }

Hope it helped.

Solution 10 - Highcharts

For those that use Typescript you can set the Highcharts.TitleOptions to hide the chart title.

title: {
  text: undefined
},
subtitle: {
  text: undefined
}

Solution 11 - Highcharts

Here is the solution

title: {
    text: null
},
subtitle: {
    text: null
}

Solution 12 - Highcharts

Just write a JSON object

title : {
  style : {
    display : 'none'
  }
}

Solution 13 - Highcharts

This works for me!!!

title:false

Solution 14 - Highcharts

This is a bit of a hack but you can also try that:

title: {
    text: '<span class="hidden">My custom Hello</span>',
    align:"left",
    useHTML:true
}

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionD3ChiqView Question on Stackoverflow
Solution 1 - HighchartsjlbriggsView Answer on Stackoverflow
Solution 2 - HighchartsPlasticView Answer on Stackoverflow
Solution 3 - HighchartsTecHunterView Answer on Stackoverflow
Solution 4 - HighchartssamuellawrentzView Answer on Stackoverflow
Solution 5 - HighchartsAndyView Answer on Stackoverflow
Solution 6 - HighchartsaspadacioView Answer on Stackoverflow
Solution 7 - HighchartsThunderduckyView Answer on Stackoverflow
Solution 8 - HighchartsLong HuynhView Answer on Stackoverflow
Solution 9 - HighchartsIvaView Answer on Stackoverflow
Solution 10 - HighchartsAndrien PecsonView Answer on Stackoverflow
Solution 11 - HighchartsRahulKurumkarView Answer on Stackoverflow
Solution 12 - HighchartsAshish BardiyaView Answer on Stackoverflow
Solution 13 - HighchartsNikhil TayalView Answer on Stackoverflow
Solution 14 - HighchartsHugo ChanView Answer on Stackoverflow