0

優れたnvd3ライブラリでいくつかの積み上げ棒グラフを使用しています(これら: http://nvd3.org/examples/multiBar.html )

でも問題があります。マウスオーバー ツールチップをそのまま使用したいのですが、「on」という単語を別の言語に翻訳する必要があります。その方法に関するドキュメントが見つからず、ソースコードで見つからないようです。

誰にも手がかりがありますか?

4

1 に答える 1

1

バージョン 1.7.1 以下 (使用していると思われます) では、 を使用できますchart.tooltipContent()

// If you want to change the tooltip format you could edit this function
chart.tooltipContent(function (key, x, y, e, graph) {
    return '<h3>' + key + '</h3>' +
        '<p>' +  y + ' en ' + x + '</p>'
});

例については、このプランクを参照してください: http://plnkr.co/edit/YxZKDBqVWhtxryUSMwjk?p=preview

1.8.1 を使用する場合、同じことが次のように実現できます。

// If you want to change the tooltip format you could edit this function
chart.tooltip.contentGenerator(function (d) {
    return '<h3>' + d.data.key + '</h3>' +
        '<p>' +  d.data.display.y + ' en ' + new Date(d.data.x).toLocaleDateString() + '</p>'
});

このプランクに示すように: http://plnkr.co/edit/ZYsjygDJkHSit50Rh3sZ?p=preview

于 2015-08-11T21:58:53.887 に答える