如何编辑高图箱线中的工具提示文本 [英] How to edit the tooltip text in a highcharts boxplot

查看:89
本文介绍了如何编辑高图箱线中的工具提示文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想更改箱子图上弹出的文字。



api 以及链接的示例,我认为这将是为该系列添加格式化函数的一种情况。所以我参加了演示并点击了在jsFiddle中编辑。然后我改变了:

  tooltip:{
headerFormat:'< em>实验号{point.key}< ; / em>< br />'
}

 工具提示:{
headerFormat:'< em>实验否{point.key}< / em>< br / >',
formatter:function(){return'some random string'; } b





我希望工具提示变成'一些随机字符串'(就像发生的那样在从工具提示API参考链接的演示),但它没有改变。任何提示?

解决方案

formatter 应该被添加到 tooltip 主选项对象的属性。



此处演示: http://jsfiddle.net/kxbXx/


I want to change the text of the popup on a box plot.

From the api and the example linked there, I assumed it would be a case of adding a formatter function to the series. So I went to the demo and clicked 'Edit in jsFiddle'. I then changed:

tooltip: {
    headerFormat: '<em>Experiment No {point.key}</em><br/>'
}

to

tooltip: {
    headerFormat: '<em>Experiment No {point.key}</em><br/>',
    formatter: function() { return 'some random string'; }
}

I expected the tooltip to change to 'some random string' (as happens in the demo linked from the tooltip api reference), but it was unchanged. Any hints?

解决方案

The formatter should be added to the tooltip property of the main options object.

Demo here: http://jsfiddle.net/kxbXx/

这篇关于如何编辑高图箱线中的工具提示文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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