title: hide dataset by default using Chart.js and a custom script
body: <p>I'm using wpDataTables plugin on my WordPress website to draw some tables and charts. The charts are rendered using Chart.js. The developers of the plugin created a custom script to control some more aspects of Chart.js than the plugin can handle out of the box.</p>
  
  <p>That's the script:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  jQuery(window).load(function(){
      if( typeof wpDataChartsCallbacks == 'undefined' ){ wpDataChartsCallbacks = {}; }
      wpDataChartsCallbacks[39] = function(obj){
          obj.options.options.scales.yAxes[0].display = false;
          obj.options.options.scales.xAxes[0].display = false;
      }
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>In this example it hides the axes of the chart with the ID 39. I need to change the above script to hide a specific dataset (line in the chart) by default. My chart ID is 2 and I want to hide the dataset labelled "SPM".</p>
  
  <p>You can take a look at the table and chart how it currently looks like here (it's a weapon overview of a game, so please do not wonder): <a href="https://mydivision.net/the-division-waffen/" rel="nofollow noreferrer">https://mydivision.net/the-division-waffen/</a></p>
  
  <p>The first chart has all datasets visible by default:
  <a href="https://i.stack.imgur.com/IipHA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IipHA.png" alt="enter image description here"></a>
  I want it to look like this by default ("SPM" line hidden):
  <a href="https://i.stack.imgur.com/HcWDR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HcWDR.png" alt="enter image description here"></a></p>
  
  <p>Can anyone please assist how to do that?</p>