title: Using chartist in Jenkins throws - TypeError: self is undefined
body: <p>Trying to use chartist.js in a jenkins plugin.
  I've imported the libary with cdn - regular import (and the css).</p>
  
  <p>But I get "TypeError: self is undefined" in the browser debug instead of showing the chart. I'm using the most simple chartist.js example from  their site.</p>
  
  <p>This is the source code of the function that creates the error:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>  /**
     * Adds one or a space separated list of classes to the current element and ensures the classes are only existing once.
     *
     * @memberof Chartist.Svg
     * @param {String} names A white space separated list of class names
     * @return {Chartist.Svg} The wrapper of the current element
     */
    function addClass(names) {
      this._node.setAttribute('class',
        this.classes(this._node)
          .concat(names.trim().split(/\s+/))
          .filter(function(elem, pos, self) {
            return self.indexOf(elem) === pos;
          }).join(' ')
      );
  
      return this;
    }</code></pre>
  </div>
  </div>
  </p>