我使用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'
}
}
答案 0 :(得分:0)
没有为工具提示命名为“ height”的配置,因此它将无法正常工作。
tooltips: {
height:10
}
相反,您可以使用 bodyFontSize ,工具提示的高度将根据您为其分配的值进行更改。
tooltips: {
bodyFontSize:15
}
并使用 position 和 mode 选项更改工具提示的位置。