我正在使用react-google-charts构建一个 AreaChart,并在我的图表中的两个不同区域添加自定义工具提示。我的数据数组的格式为:
['X', 'NegativeY', 'PositiveY', { role: "tooltip", type: "string", p: {html: true}}]
我的数据条目是结果格式:
[x, y, null, 'X: ' + x ". Y: " + Y] // if y > 0
[x, null, y, 'X: ' + x ". Y: " + Y] //if y < 0
在选项字典中,我添加了以下内容:
tooltip: { isHtml: true, trigger: "visible" }
目前,自定义工具提示仅针对负 Y 区域显示,默认 Google 工具提示针对正区域显示。我希望自定义工具提示也能显示在正区域。这可能吗?