扫码关注官方订阅号
如下效果:
全部代码:http://runjs.cn/code/uqvidqwj
认证0级讲师
刚才看了下源码,可能我看的不是很清楚,目前我看到的结果是如果不改动源码的话,这个功能貌似不行
源码中有这么一段:
getLabelConfig: function() { var point = this; return { x: point.category, y: point.y, key: point.name || point.category, series: point.series, point: point, percentage: point.percentage, total: point.total || point.stackTotal } }
所以使用format的时候貌似只能替换这几个值,我暂时没有找到可以设置的地方
series的translate方法中有这几个值的计算方法
................ data: [ { x:xValue, y:yRatio, id:'id_'+ i, myData:toolTipContents, events:{ mouseOver:function(event){ //alert("mouseover"); //console.log(this); //console.log(this.options.myData); //chart.get('highest'); } } }], ..... tooltip: { shared: true, useHTML: true, headerFormat: '<b>'+specDateTimeStr+'{series.name}</b><br><table>', pointFormat: '{point.options.myData}', footerFormat: '</table>' },
toolTipContents 可以使用HTML格式
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
刚才看了下源码,可能我看的不是很清楚,目前我看到的结果是如果不改动源码的话,这个功能貌似不行
源码中有这么一段:
所以使用format的时候貌似只能替换这几个值,我暂时没有找到可以设置的地方
series的translate方法中有这几个值的计算方法
toolTipContents 可以使用HTML格式