Is there a way to disable the Title and Subtitle i

2020-02-20 05:35发布

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
13条回答
三岁会撩人
2楼-- · 2020-02-20 06:16

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.

查看更多
放我归山
3楼-- · 2020-02-20 06:16

I prefer this method :

title: {
    text: '',
    style: {
        display: 'none'
    }
},
subtitle: {
    text: '',
    style: {
        display: 'none'
    }
},
查看更多
贪生不怕死
4楼-- · 2020-02-20 06:17

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/

查看更多
对你真心纯属浪费
5楼-- · 2020-02-20 06:21

Just write a JSON object

title : {
  style : {
    display : 'none'
  }
}
查看更多
Viruses.
6楼-- · 2020-02-20 06:23

Here is the solution

title: {
    text: null
},
subtitle: {
    text: null
}
查看更多
我命由我不由天
7楼-- · 2020-02-20 06:23

In react-native below code worked for me,

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

Hope it helped.

查看更多
登录 后发表回答