在极坐标图中,将鼠标悬停在点上时显示工具提示

时间:2018-12-04 11:10:22

标签: highcharts

在极坐标图中,仅将鼠标悬停在点上时显示工具提示,而不像this image 感谢TorsteinHønsi的这张图表

    <script src="http://code.highcharts.com/highcharts.js"></script>
    <div id="container" style="height: 400px"></div>
    <script>
    $(function () {
        $('#container').highcharts({
            chart: {

                type: 'scatter'
            },
            plotOptions: {
        series: {
            stickyTracking: false
        }
    },
    tooltip: {
        snap: 0
    },

            series: [{
                lineWidth:2,
                data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]        
            }]
        });
    });
    </script>
<a href="http://jsfiddle.net/qNLu2/1/">Example</a>

1 个答案:

答案 0 :(得分:0)

stickyTracking属性设置为false

Highcharts.chart('container', {
    chart: {
        polar: true
    },
    series: [{
        stickyTracking: false,
        data: [43934, 52503, 57177, 69658, 97031, 119931, 137133, 154175]
    }]
});

API参考:https://api.highcharts.com/highcharts/series.line.stickyTracking

实时演示:http://jsfiddle.net/BlackLabel/2ya5dwfL/