我正在使用primefaces和jqplot库。
在我的计件中,我具有扩展程序属性,而在javascript函数中,我有以下内容:
this.cfg.highlighter = {
show:true,
tooltipLocation: 'n',
tooltipAxes: 'y',
useAxesFormatters: false,
tooltipFormatString: '%s'
}工具提示显示节值,但不显示节百分比。
有人知道如何在工具提示中显示百分比值吗?
谢谢。
发布于 2014-06-12 07:06:53
可以绑定突出显示事件以修改工具提示:
$("#chart1").bind('jqplotDataHighlight', function(ev, seriesIndex, pointIndex, data) {
var highlightToolTip = $(".jqplot-highlighter-tooltip");
var pct = Math.round(data[1]/total*100);
highlightToolTip.html(data[0]+", "+pct+"%");
});其中:
请参阅小提琴在这里上的一个工作示例
https://stackoverflow.com/questions/24145901
复制相似问题