0

我正在使用 Jquery Sparkline 插件在我的网站上绘制折线图,​​它工作正常,但我想编辑它的工具提示。我阅读了他们官方网站上提供的整个工具提示文档,但没有积极的结果。

这是我的代码:

$(".sparkline").each(function () {
    var $this = $(this);
    $this.sparkline('html', $this.data(), {
        type: "line",
        tooltipSuffix: " Tweets : "
    });
});

我正在绘制推文数与小时图,所以我只想显示“y Hrs 的 x Tweets”,有人可以帮我解决这个问题吗?

4

1 回答 1

0

我认为您需要的文档可以在这里找到:http: //omnipotent.net/jquery.sparkline/#tooltips

您可能可以使用 tooltipFormat 来声明如下内容:

tooltipFormat: '{{x}} Tweets at {{y}} hrs',
于 2014-07-22T06:42:11.903 回答