样式模式下的 Highcharts 工具提示行高
Highcharts tooltip line height in styled mode
我正在尝试在样式模式下增加 Highcharts 工具提示中的行距。我尝试使用 CSS 在 .highcharts-tooltip 及其文本和 tspan 元素上设置行高:
.highcharts-tooltip,
.highcharts-tooltip text,
.highcharts-tooltip tspan
{
line-height: 40px;
}
我也尝试过使用 tooltip.style 选项:
tooltip: {
style: { lineHeight: 40 }
}
这两种方法在样式模式下都没有任何效果。有没有人设法做到这一点?
您需要为工具提示启用 useHTML
属性。
tooltip: {
useHTML: true,
...
}
CSS:
.highcharts-tooltip {
line-height: 40px;
}
我正在尝试在样式模式下增加 Highcharts 工具提示中的行距。我尝试使用 CSS 在 .highcharts-tooltip 及其文本和 tspan 元素上设置行高:
.highcharts-tooltip,
.highcharts-tooltip text,
.highcharts-tooltip tspan
{
line-height: 40px;
}
我也尝试过使用 tooltip.style 选项:
tooltip: {
style: { lineHeight: 40 }
}
这两种方法在样式模式下都没有任何效果。有没有人设法做到这一点?
您需要为工具提示启用 useHTML
属性。
tooltip: {
useHTML: true,
...
}
CSS:
.highcharts-tooltip {
line-height: 40px;
}