ChartJs工具提示高度选项不起作用

时间:2020-06-10 08:41:55

标签: chart.js

我使用ChartJs来显示图形,我尝试根据height文档在options上使用ChartJs来汇总工具提示高度。

https://www.chartjs.org/docs/latest/configuration/tooltip.html

但是它不起作用。 这是我在图表上的option

options {
    tooltips: {
        mode: 'point',
        intersect: true,
        xPadding: 10,
        yPadding: 10,
        bodySpacing: 4,
        backgroundColor: '#fff',
        borderColor: '#eff6ff',
        borderWidth: 2,
        height: 10,
        titleFontColor: '#1fb7c7',
        bodyFontColor: '#333333'
    }
}

myCurrentTooltip 我需要这样制作工具提示。

tooltipWannaBe

1 个答案:

答案 0 :(得分:0)

没有为工具提示命名为“ height”的配置,因此它将无法正常工作。

tooltips: {
    height:10
}

相反,您可以使用 bodyFontSize ,工具提示的高度将根据您为其分配的值进行更改。

tooltips: {
   bodyFontSize:15
}

并使用 position mode 选项更改工具提示的位置。

相关问题