简体   繁体   English

Highcharts 3D散点图:悬停点时显示更改说明

[英]Highcharts 3D Scatter Plot: Change Description shown when hovering points

I am totally new to Highcharts, and I would like to know, if you can change the content of the "description box" shown for a point, when hovering over it with the mouse. 我对Highcharts完全陌生,我想知道,当您将鼠标悬停在某个点上时,是否可以更改所显示的“描述框”的内容。

I tried: https://jsfiddle.net/by0sxgz1/17/ Using the pointDescriptionFormatter option for a series, but it does not work. 我尝试了: https ://jsfiddle.net/by0sxgz1/17/对系列使用pointDescriptionFormatter选项,但是它不起作用。

Code Snippet: 代码段:

series: [
{
    name: 'mySeries1',
    accessibility: {
        enabled: true,
        pointDescriptionFormatter: function() {
            return "Hello"
        }
    },
    data: [{x:1, y:1, z:1},{x:2, y:2, z:2}]
}

I would like to see "Hello" in the small box over a point (when hovering with the mouse), instead of the normal description, which is Series and the x,y and z values. 我想在一个小框上看到“ Hello”(用鼠标悬停时),而不是通常的描述,即Series和x,y和z值。

What did I get wrong? 我怎么了?

I am thankful for any link or tutorial aswell :) 我也感谢任何链接或教程:)

Add this to your highchart config: 将此添加到您的highchart配置:

tooltip: { 
        useHtml:true,   
        formatter: function() { 
        return "<div style='width:140px;text-align:center;'>Hello!</div>"; 
        } 
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM