Wijmo UI for the Web
Clickable Legend
Wijmo User Guide > Widgets > Chart Widgets > BarChart > BarChart Concepts > Clickable Legend

By default, the bar chart allows users to click a legend entry to toggle the data series it represents in the chart. The first click hides the bars for the data series. The second click toggles the bars for the data series back to visible.

Toggled Off

Toggled Off

Toggled On

Toggled On

You may not always want to allow this functionality. If you want to disable it, add code like the following to your script, inside the document ready function:

Turn Off Legend Click Function
Copy Code
$(".wijchart-legend").click(function () { return false;});

The entire script looks something like this:

Chart Script
Copy Code
<script id="scriptInit" type="text/javascript">
    $(document).ready(function () {
        $("#wijbarchart").wijbarchart({
            seriesList: [{
                label: "2012 Auto Sales",
                legendEntry: true,
                data: { 
                    x: ['Ford', 'GM', 'Chrysler', 'Toyota', 'Nissan', 'Honda'], 
                    y: [.05, .04, .21, .27, .1, .24] 
                }
            }],
        });
        $(".wijchart-legend").click(function () { return false;});
    });
</script>
See Also

Widgets

How To