简体   繁体   English

Highcharts 3D散点在工具提示中未显示名称

[英]Highcharts 3D scatter points not showing names in tooltips

I modified the example found here to add names to the data points but the tooltip is not showing the names. 我修改了此处找到的示例以将名称添加到数据点,但工具提示未显示名称。 It shows the series name but not the point name: 它显示系列名称,但不显示点名称:

 ---------
|o Points |
|x: 2     |
|y: -6    |
|z: 2     |
 ---------

Here is my jsFiddle . 这是我的jsFiddle My series data is defined as: 我的系列数据定义为:

series: [{
    name: "Points",
    data: [{
    color:"rgb(0,0,0)",
        x:5,
        y:-5,
        z:9,
        name:"Point 1"
    },{
        color:"rgb(0,0,0)",
        x:2,
        y:-6,
        z:2,
        name:"Point 2"
    },{
        color:"rgb(0,0,0)",
        x:7,
        y:6,
        z:8,
        name:"Point 3"
    }]
}]

I thought it should show the point name in the tooltip as shown in this 2D example.Is this a bug or am I doing something wrong? 我认为应该在提示显示点名称,如图中这种 2D example.Is这个错误还是我做错了什么?

Highcharts JS v4.0.4 Highcharts JS v4.0.4

You have to define your own tooltip formatter : 您必须定义自己的工具提示格式化程序

tooltip: {
    formatter: function(chart) {
        var p = this.point;
        return p.name + '<br>' + 
               p.x + ', ' + p.y + ', ' + p.z;
    }
}

Here is a working example: http://jsfiddle.net/aLLj8j0m/2/ 这是一个工作示例: http : //jsfiddle.net/aLLj8j0m/2/

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

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