如何使用highcharts在工具提示中隐藏一个系列数据信息

Nov*_*vis 3 legend series hide highcharts

嗨,我得到一个以下图表:在此输入图像描述

我想隐藏工具提示中的水信息.我怎样才能做到这一点.您可以使用以下小提琴来玩它.

谢谢!!!

wer*_*eld 7

你快到了.您需要检查共享工具提示格式化程序的API .检查你不想要的系列中的每一个:

...
            tooltip: {
                formatter: function () {
                    var s = '<b>' + this.x + '</b>';
                    $.each(this.points, function () {
                        if (this.series.name != 'Water') {
                            s += '<br/>' + this.series.name + ': ' + this.y + 'm';
                        }                       
                    });
                    return s;
                },
                shared: true,
                valueSuffix: ' cm'

            },
...
Run Code Online (Sandbox Code Playgroud)