C3.js一页上有更多图表工具提示并单击仅适用于最后一个的图例

问题描述

我在同一页面上创建多个图表(使用相同的功能):

    function createChart3(graphxas,graphdata,bindto,title) {
    var chart = bb.generate({
        bindto: "#" + bindto,size: {
            height: 500,width: 1500
        },tooltip: {
            show: true,position: function(data,width,height,element) {
                return { top: element.y.animVal.value,left: element.x.animVal.value}
            }            
        },legend: {
            position: "right"
        },data: {       
            x: "xlabels",labels: true,columns: [["xlabels"].concat(graphxas)].concat(graphdata),type: "bar",axis: {
                x: {
                    type: "category",tick: {
                        rotate: -60,multiline: false,tooltip: true
                    },height: 50
                },y: {
                    padding: {
                        top: 0,bottom: 0
                    },min: 0
                }                    
            },},title: {
            text: title
        }
    });
}

看起来有些事件被覆盖或类似的东西。工具提示仅在最后生成的图表上起作用,因为图例单击事件也仅在最后生成的图表上触发。如何防止这种行为?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)