gpt4 book ai didi

jquery - 使用 jquery.flot.tooltip 的堆叠图中的%p 百分比不起作用

转载 作者:行者123 更新时间:2023-12-01 04:09:21 26 4
gpt4 key购买 nike

我使用 jquery.flot.js (v 1.1) 来显示图表和工具提示 jquery.flot.tooltip.js (版本:0.6.7)

我想在堆积图中显示每个堆栈覆盖的百分比面积。我已经用 %p 尝试过。但它不起作用,它在工具提示中返回“%p”。代码片段:

tooltip: true,
tooltipOpts: {
content: "%s : %y : %p.1%"
}

我的图表是-

enter image description here

有人可以帮我吗?

最佳答案

仅当您还使用饼图插件时才可以使用%p http://www.flotcharts.org/flot/examples/series-pie/index.html ,引入该占位符只是为了支持该插件。我发现文档中并不清楚。

在您的情况下,您需要自己计算百分比值。您可以为此使用回调函数。格式为function(label, xval, yval, flotItem)并且必须返回正确格式的字符串(工具提示需要)。

希望对你有帮助!

关于jquery - 使用 jquery.flot.tooltip 的堆叠图中的%p 百分比不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22665992/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com