Highcharts工具提示-去除标记点?

4xrmg8kj  于 2023-02-23  发布在  Highcharts
关注(0)|答案(1)|浏览(243)

我想摆脱小圆点在我的工具提示显示。我正在使用 highcharts 。我可以请你帮助修改这个功能,这里是我的代码:

Highcharts.getJSON(
  'https://code.highcharts.com/mapdata/custom/world.topo.json',
  topology => {
 
    const chart = Highcharts.mapChart('container', {
      chart: {
        map: topology
      },
 
      title: {
        text: ''
      },
 
      legend: {
         enabled: false,
         align: 'center',
         verticalAlign: 'bottom',
         itemStyle: {
             fontWeight: 'bold',
             fontSize: '20px'
         }
     },
 
      mapNavigation: {
        enabled: true,
        enableDoubleClickZoomTo: true,
        buttonOptions: {
          align: 'right',
          verticalAlign: 'bottom'
        }
      },
 
      mapView: {
        maxZoom: 30,
        projection: {
          name: 'Orthographic',
          rotation: [60, -30]
        }
      },
 
      colorAxis: {
                         min: 0,
                         max: 100,
                         text: '',
                         stops: [[0, 'darkgrey', ''], [0, '#5ce1e6', '{{question['answer1']}}'], [0.49, '#c9f5f7', ''], [.50, '#aee0a0', ''], [.51, '#fff4c8', ''], [1, '#ffde59', '{{question['answer2']}}']],
                         title: {
                          text: '',
                          },
                     },
 
      credits: {
        enabled: false
      },
 
      tooltip: {
        useHTML: true,
        pointFormat: '{point.name} <br> <div style="display: inline-block;" class="square-answer1-globe"></div>{{question["answer1"]}}: {point.value1}% <br> <div style="display: inline-block;" class="square-answer2-globe"></div>{{question["answer2"]}}: {point.value2}%',
        backgroundColor: 'black',
        style: {
        color: 'white'
         },         
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
     },

      plotOptions: {
        series: {
          animation: {
            duration: 750
          },
          clip: false

        }
      },
 
      mapline: {
             color: Highcharts.getOptions().colors[0]
           },
      series: [{ 
           name: 'Graticule',
           id: 'graticule',
           type: 'mapline',
           data: getGraticule(),
           nullColor: 'lightgrey',
           color: 'lightgrey',
           accessibility: {
          enabled: false
        },
        enableMouseTracking: false
         },
        
      
      {
        data,
        joinBy: 'name',
        name: '',
        states: {
          hover: {
             color: '',
            borderColor: '#000000'
          }
        },
     
        accessibility: {
          exposeAsGroupOnly: true
        }
      }]
    });

以下是显示内容的图像:enter image description here
我想去掉工具提示框左上角的小圆点。我一直在尝试所有的方法,它似乎总是出现在那里。我试过添加“标记:false”,但也许我没有在正确的位置输入它(不确定这是否是正确的代码)。

w6mmgewl

w6mmgewl1#

您可以使用formatter选项作为工具提示,类似于以下内容,但要添加您的值:

tooltip: {
    formatter: function(tooltip) {
      return `${question1}: <b>${percentage1}</b><br/>`
    }
  },

下面是有关它的文档:https://api.highcharts.com/highcharts/tooltip.formatter

相关问题