Highcharts中条形图的dataLabels在3.0.8中不显示空值 [英] dataLabels for bar chart in Highcharts not displaying for null values in 3.0.8

查看:445
本文介绍了Highcharts中条形图的dataLabels在3.0.8中不显示空值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



I've been using the following code to set dataLabels for bar charts in Highcharts...

plotOptions: {
    bar: {
        dataLabels: {
            enabled: true,
            formatter: function() {
                if (this.y==null) {
                    return '<i>(Suppressed)</i>';
                } else {
                    return '';
                }
            }
        }
    }
}

基本上,我希望能够向用户展示某个值因隐私原因而被隐藏。

Basically, I want to be able to show the user when a value has been hidden for privacy reasons.

在之前的Highcharts版本中,标签会显示按照我的意愿设置空值。在3.0.8版本中,我没有获得空值的任何dataLabels。

In previous versions of Highcharts, the label would show up for the null values as I desired. In version 3.0.8, I do not get any dataLabels for the null vales.

是否有解决方法或解决方案?

Is there a workaround or fix for this?

推荐答案

可能存在bug,这里报道 https://github.com/highslide-software/highcharts.com/issues/2899

Possibly bug, reported here https://github.com/highslide-software/highcharts.com/issues/2899

解决方法:使用renderer http://api.highcharts.com/highcharts#Renderer.text

Workaround: use renderer http://api.highcharts.com/highcharts#Renderer.text

这篇关于Highcharts中条形图的dataLabels在3.0.8中不显示空值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆