如何在Yii2 Highcharts扩展中正确创建PHP格式化函数 [英] How to correctly create function for formatter on PHP in Yii2 Highcharts extension

查看:145
本文介绍了如何在Yii2 Highcharts扩展中正确创建PHP格式化函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当鼠标悬停在由Highcharts提供的图表中的具体点上时,我必须显示一些特殊信息。我为Yii2使用了Highcharts扩展程序。



我的代码
$ b

 'tooltip'=> [
'enabled'=> true,
'footerFormat'=> true,
'formatter'=> js:function(){
return'my special information';
}

来自控制器的数据是正确的。
然而没有什么不同 - tooltip仍然是默认的


我做错了什么?

解决方案

对不起。我的错。一切工作正常。我只是复制'tooltip'选项。我想用的工具提示被工具提示覆盖,我忘了从我的代码中删除)

I have to display some special information when my mouse is over a concrete point in a chart that is provided by Highcharts. I am using the Highcharts extension for Yii2.

My Code

'tooltip' => [
               'enabled' => true,
               'footerFormat' => true,
               'formatter' => "js:function() {
                    return 'my special information';
                }"
             ],

The data that comes from controller is correct. However there is nothing different - tooltip is still the default

What am I doing wrong?

解决方案

Sorry. My bad. All is working fine. I just duplicate 'tooltip' option. And my tooltip that i want to use was override by tooltip that i forgot to remove from my code)

这篇关于如何在Yii2 Highcharts扩展中正确创建PHP格式化函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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