避免在 c3js 图形上取消选择行为

Avoid unselect behavior on c3js graph

我正在创建一个包含数据点的折线图,每个数据点都应根据数据具有不同的样式,我正在使用您提供的 select API 实现此目的给我们 如本例所示 enter link description here 问题是,用户可以 select 和 unselect 其他点,我想避免这种行为 这可能吗?

var chart = c3.generate({
    data: {
        columns: [
            ['data1', 30, 200, 100, 400, 150, 250],
            ['data2', 50, 20, 10, 40, 15, 25]
        ],
        selection: {
            enabled: true
        }
    },
    point: {
        focus: {
            expand: {
                enabled: false
            }
        }
    }
});
chart.select(['data1'], [1, 3, 5]);

如果您只想将点锁定在当前 expanded/unexpanded 状态,请添加

chart.internal.config.data_selection_enabled = false;

在您的 chart.select 通话后

http://jsfiddle.net/jrdsxvys/316/