HighCharts - 在值为0或null的列上显示工具提示 [英] HighCharts - Show tooltip on column where value is 0 or null

查看:480
本文介绍了HighCharts - 在值为0或null的列上显示工具提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在公司的框架中实施了HighCharts,我可以说我们对它非常满意。但是我们有一个问题,我们不知道如何解决。

I had implemented the HighCharts in the framework in my company, and I can say that we are super satisfied with it. But we have a problem, we don't know how to solve.

在列图中,当一列的值等于零时,它没有关于它,该列只是省略。当用户将鼠标悬停在值等于0的列的空间上时,我希望它显示在工具提示中。

In column graphs, when a column has its value equal to zero, it is no visual information about it, the column is just omitted. I want it displayed in a tooltip when the user mouses over the space of the column where the value is equal to 0.

观察下面的小提琴生成条形图的位置有几个值为0或无价值的列。

Watch the fiddle below where it generates a bar chart with several columns with value 0, or worthless.

JsFiddle

图表运行的方法:

GraficoBarra(arrayPropriedades, arrayDados, arrayDrillDown);


推荐答案

正如@wergeld所说,你需要通过0-基于值的选项,否则您将不会显示任何内容。对于空值,它是不可能的,因为它没有价值。

As @wergeld said, you need to pass 0-based values to options, otherwise you won't get displayed nothing at all. For nulls it's no possible, since this doesn't have value.

现在,您需要将 minPointLength 设置为某个值(如10),然后甚至0值将显示为小条。请参阅演示: http://jsfiddle.net/EJK4e/12/

Now,you need to set minPointLength, to some value (like 10), then even 0-values will be displayed as small bars. See demo: http://jsfiddle.net/EJK4e/12/

只是为了在同一页面上 - 要显示工具提示,你需要点图形,否则将没有用于触发工具提示显示的悬停事件。

Just to be on the same page - to display tooltip, you need point graphic, otherwise there will be no hover event for triggering tooltip to show up.

这篇关于HighCharts - 在值为0或null的列上显示工具提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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