Wijmo UI for the Web
Clickable Legend
Wijmo User Guide > Widgets > Chart Widgets > BubbleChart > BubbleChart 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 () {
    $("#wijbubblechart").wijbubblechart({
        axis: {
            y: {text: "Number of Products"},
            x: {text: "Sales", annoFormatString: "C0"}
        },
        seriesList: [
        {
            label: "Company A Market Share",
            data: {y: [14], x: [12200], y1: [.15]}
        }, {
            label: "Company B Market Share",
            data: {y: [20], x: [60000], y1: [.23]}
        }, {
            label: "Company C Market Share",
            data: {y: [18], x: [24400], y1: [.1]}
        }]
    });
    $(".wijchart-legend").click(function () {return false;});
});
</script>
See Also

How To

Widgets

Reference