Angular 中的 Highcharts 和工具提示下的箭头

时间:2021-03-18 13:23:46

标签: angular highcharts

我正在尝试在进度条下添加工具提示,它总是在相同的位置。当我在 formatter 中更改工具提示位置时,工具提示显示在正确位置,但上方没有箭头。我可以强制工具提示始终在顶部显示工具提示的箭头吗?这是工具提示数据:

tooltip: {
    backgroundColor: '#414141',
    borderRadius: 8,
    border: '1px solid red',
    borderWidth: 0,
    shadow: false,
    style: {
      color: 'white',
    },
    formatter: () => {
      const toolTipText = this.data.map(({ name, value }) => `<div>${name}: <b>${value}</b></div><br>`);

      return toolTipText.toString().replace(/\,/g, '');
    },

    positioner(labelWidth, labelHeight, point) {
      return {
        x: this.chart.chartWidth / 2 - labelWidth / 4,
        y: point.plotY + 8,
      };
    },
  }

image of bar

0 个答案:

没有答案
相关问题