title: JQPlot Hide Lines from Legend Click
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/14201911/dynamic-flot-graph-show-hide-series-by-clicking-on-legend-text-or-box-on-graph">Dynamic Flot graph - show hide series by clicking on legend text or box on graph</a>  </p>
  </blockquote>
  
  
  
  <p>I am using JQPlot and I have a question about hiding lines if they have been clicked on in the legend.</p>
  
  <p>Here is my code:</p>
  
  <pre><code> var plotCustomerSurveyGraph = $.jqplot('CustomerSurveyLineGraph', [[0,1,3,2,3,0,1,3,1,2,3,1,2], [1,2,3,1,1,2,2,3,3,1,2,1,2], [1,2,3,4,4,3,2,2,1,4,3,2,2], [0,1,3,3,1,2,2,1,1,0,0,1,2],[2,2,3,3,4,4,0,2,0,1,1,3,3], [2,2,3,3,1,1,0,1,0,2,3,3,1], [1,3,1,4,3,3,1,2,3,4,1,2,1], [2,1,3,2,1,2,0,1,2,4,2,1,0]], 
  { 
              axes:
              {
                  xaxis:
                  {
                        label: "Date (Week)",
                        ticks: ['1','2','3','4','5','6','7','8','9','10','11','12','13']
                  },
                  yaxis:
                  {
                      label: 'Rating',
                      labelRenderer: $.jqplot.CanvasAxisLabelRenderer,
                      ticks: ['0','1','2','3']
                  }
              },
      title:'Customer Survey (Last 3 Months)',
              width: 480, height: 480,
              legend:{show:true, location: 'e', placement: 'outsideGrid'},
      seriesDefaults: 
      {
                  rendererOptions: {smooth: true}
      },
      series:[ 
                  {
                      lineWidth:1, 
                      label:'Staff Appearance',
                      markerOptions: { size:7, style:'dimaond' }
                  }, 
                  {
                      lineWidth:1, 
                      label:'Staff Product Knowledge',
                      markerOptions: { size: 7, style:"dimaond" }
                  }, 
                  {
                      lineWidth:1, 
                      label:'Staff Friendliness',
                      markerOptions: { size:7, style:"filledSquare" }
                  }, 
                  {
                      lineWidth:1, 
                      label:'Staff Wait Time Acceptable',
                      markerOptions: { size:7, style:"filledSquare" }
                  }, 
                  {
                      lineWidth:1, 
                      label:'Food Value For Money',
                      markerOptions: { size:7, style:"filledSquare" }
                  }, 
                  {
                      lineWidth:1, 
                      label:'Overall Quality of Meal',
                      markerOptions: { size:7, style:"filledSquare" }
                  }, 
                  {
                      lineWidth:1, 
                      label:'Cleanliness of the Premises',
                      markerOptions: { size:7, style:"filledSquare" }
                  }, 
                  {
                      lineWidth:1, 
                      label:'Ambience and Atmosphere of the Premises',
                      markerOptions: { size:7, style:"filledSquare" }
                  }
                  ]
      }
  ); 
  </code></pre>
  
  <p>And here is an image of the graph:</p>
  
  <p><img src="https://i.stack.imgur.com/T4zBV.jpg" alt="enter image description here"></p>
  
  <p>Is it possible to enable a feature to hide/show the lines depending on whether they have been clicked in the legend? If so, can I please have some help to do this?</p>
  
  <p>Thanks</p>