Ensure at least one Legend Item is ON

This solution is not perfect. The last ON legend item should not display a "hand" cursor, like if it were enabled. Clicking it will do nothing.

by duarteleao

HTML

<script src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.1.19/require.min.js"></script>
<script src="//webdetails.github.io/ccc/charts/lib/amd/require.config.js"></script>
<script src="//webdetails.github.io/ccc/charts/lib/q01-01.js"></script>
<div id="cccExample" />

JavaScript

// NOTE: this is now standard behaviour.
// The old way, it was like this: https://jsfiddle.net/duarteleao/fp694xLg/

require([
  "ccc/pvc", 
  "ccc/def", 
  "ccc/protovis"
], function(pvc, def, pv) {

    new pvc.BarChart({
        canvas: "cccExample",
        width:  500,
        height: 400,
        title:      "Ensure at least one Legend Item is ON",
        animate:    false,
        selectable: true,
        hoverable:  true,
        legend:     true
    })
    .setData(relational_04, {crosstabMode: false })
    .render();
});