如何禁用隐藏/显示图表的功能,当用户点击图表传奇与盾盾

how to disable the functionality to hide/show the chart when user click ChartLegend with ShieldUI?

本文关键字:用户 传奇 隐藏 何禁用 显示图 功能      更新时间:2023-09-26

这里我们有一个shield图表的例子,如果有人可以禁用隐藏/显示图表的功能,当用户点击CharLegent?我的意思是,正如你所看到的,当用户点击"制动距离"时,黄色图表被隐藏了。我想禁用这种功能

您应该停止在legendSeriesClick事件处理程序函数中触发事件,如下所示:

$(document).ready(function () {
    $("#chart").shieldChart({
        ...
        events: {
            legendSeriesClick: function (e) {
                // stop the series item click event, so that 
                // user clicks do not toggle visibility of the series
                e.preventDefault();
            }
        }
    });
});