如何减少图表中工具提示框的空间?

时间:2019-05-16 12:03:31

标签: highcharts

我正在创建新的variablepie highchart js。在该图中如何减小工具提示框的空间(高度)。我需要减少工具提示框内的顶部和底部空间。

URL:https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/demo/variable-radius-pie

   tooltip: {

           headerFormat: '',
            pointFormat: ' <b>COMPANY</b><br/>' +
                'Match Percent: <b>{point.y}</b><br/>' +
                'Score Weight: <b>{point.z}</b><br/>',
                valueSuffix: ' %',
                useHTML: true,
                outside: true,
                style: {
                        padding: 0
                },
                followPointer:true
        },

1 个答案:

答案 0 :(得分:1)

您需要直接在padding配置对象中设置tooltip

tooltip: {
    padding: 0,
    ...
}

实时演示: https://jsfiddle.net/BlackLabel/eom8tqns/

API参考: https://api.highcharts.com/highcharts/tooltip.padding