在Forio轮廓的工具提示中显示系列名称



我在对象数组中发送数据:

 [{name: "x1" , data: [ ... ]}, {name: "x2" , data: [ ... ]} ... ]

是否可以在数据点工具提示中显示系列名称?

是的,您可以在配置中传递工具提示格式化程序,并且数据对象包含系列名称:

new Contour({
    el: '.chart',
    tooltip: {
        formatter: function (d) {
            return d.series + ': ' + d.x + ', ' d.y;
        }
    }
})
.cartesian()
.line([1,2,3,3,5,6])
.tooltip()
.render();

最新更新