如何在高图表字幕选项中添加空格

How to add blank spaces in highcharts subtitle option

本文关键字:添加 空格 选项 字幕 高图表      更新时间:2023-09-26

如何在下面的文本中添加空格

字幕: {

  text:'<b> WEL#: 0703,Number of Solar Collectors: 2, Slope (from horizontal): 32°, Orientation +32°(west), Auxilary heater: Electric, <br> Location: Westmount Street, Halifax </br> </b>',
},      

添加与背景颜色匹配

的范围
<span style="font-size:16px; color:#ffffff">.</span>

似乎高图表删除了多个中断标签(即
)以及显示为"&nbsp;"。

上面的代码是一个"白色"句点,但看起来像一个空格。

您可以尝试在换行符后附加这些行,并在每行末尾添加 ',如下所示:

{
    subtitle: "The fox went up the hill 'n" +
        "and down the other side to 'n" +
        "where the chickens lived."
}

此外,如果在尝试在页面上显示空白时没有看到空白,请尝试将其包装在<pre></pre>中以保留它。

下面是一个更深入的示例:http://www.willmaster.com/blog/javascript/strings-line-breaks.php

您可以使用

"&nbsp"在HTML中添加空格

   subtitle: {
       text:'<b> WEL#: 0703,Number of Solar Collectors: 2, Slope (from horizontal): 32°, Orientation +32°(west), Auxilary heater: Electric, &nbsp; &nbsp; Location: Westmount Street, Halifax &nbsp; &nbsp; </b>',
  },