首页 > 解决方案 > 如何更改工具提示的位置

问题描述

js 我在栏顶部的工具提示的工具提示位置遇到问题,如下图所示我如何在栏顶部创建工具提示我检查了文档但我没有找到 在此处输入图像描述 ,但我的工具提示显示如下 在此处输入图像描述

谁能指导我如何将我的工具提示放在栏的顶部这是我的代码?

datasets=[
    {
      label: 'food variance',
      data: verticalData,
      barPercentage: 10,
      barThickness: 30,
      maxBarThickness: 30,
      hoverBackgroundColor: '#4946D2',
      borderDash: 1,
      backgroundColor: '#eeeff7',
    },
  ]
options = {
    tooltips: {
      backgroundColor: '#4946D2',
    },
    // responsive: true,
    maintainAspectRatio: false,
    scales: {
      yAxes: [
        {
          ticks: {
            beginAtZero: true,
            maxBarThickness: 20,
            callback: (value) => callBack(value),
          },

          gridLines: {
            borderDash: [8, 9],
          },
        },
      ],
      xAxes: [
        {
          ticks: {
            fontSize: 12,
          },

          gridLines: {
            zeroLineColor: 'white',
            display: false,
          },
        },
      ],
    },
    legend: {
      position: 'top',
      align: 'end',
      display: display,

      labels: {
        fontSize: 10,
        fontColor: 'grey',
        usePointStyle: true,
      },
    },
  }

标签: charts

解决方案


推荐阅读