Hide Unhide dataSeries on legend click - CanvasJS JavaScript Charts

Hide Unhide dataSeries on legend click - CanvasJS JavaScript Charts

by canvasjs

HTML

<script src="https://canvasjs.com/assets/script/canvasjs.min.js"></script>
<br/><!-- Just so that JSFiddle's Result label doesn't overlap the Chart -->
<div id="chartContainer" style="height: 360px; width: 100%;"></div>

JavaScript

var chart = new CanvasJS.Chart("chartContainer",{              
  title:{
    text: "Multiple Y Axis"
  },
  toolTip: {
    shared:true
  },
  axisX:{
    valueFormatString: "####",
    interval: 1
  },
  axisY:[{
    title: "Linear Scale",
    lineColor: "#369EAD",
    titleFontColor: "#369EAD",
    labelFontColor: "#369EAD"
  },
         {
           title: "Logarithmic Scale",
           logarithmic: true,
           lineColor: "#C24642",
           titleFontColor: "#C24642",
           labelFontColor: "#C24642"
         }],
  axisY2:[{
    title: "Linear Scale",
    lineColor: "#7F6084",
    titleFontColor: "#7F6084",
    labelFontColor: "#7F6084"
  },
          {
            title: "Logarithmic Scale",
            maximum: 250,
            logarithmic: true,
            interval: 1,
            lineColor: "#86B402",
            titleFontColor: "#86B402",
            labelFontColor: "#86B402"
          }],
  data: [
    {
      type: "column",
      showInLegend: true,
      //axisYIndex: 0, //Defaults to Zero
      name: "Axis Y-1",
      xValueFormatString: "####",
      dataPoints: [
        { x: 2006, y: 6 },
        { x: 2007, y: 2 },
        { x: 2008, y: 5 },
        { x: 2009, y: 7 },
        { x: 2010, y: 1 },
        { x: 2011, y: 5 },
        { x: 2012, y: 5 },
        { x: 2013, y: 2 },
        { x: 2014, y: 2 }
      ]
    },
    {
      type: "spline",
      showInLegend: true,
      axisYIndex: 1, //Defaults to Zero
      name: "Axis Y-2",
      xValueFormatString: "####",
      dataPoints: [
        { x: 2006, y: 15 },
        { x: 2007, y: 3 },
        { x: 2008, y: 20 },
        { x: 2009, y: 10 },
        { x: 2010, y: 30 },
        { x: 2011, y: 10 },
        { x: 2012, y: 600 },
        { x: 2013, y: 20 },
        { x: 2014, y: 2 }
      ]
    },
    {
      type: "column",
      showInLegend: true,                  
      axisYType: "secondary",
      //axisYIndex: 1, //Defaults to Zero
      name: "Axis Y2-1",
      xValueFormatString:...