jQuery toggleClass example

Toggle class name on click in jQuery

by andypotanin

HTML

<div id="container"></div>
  <script src="https://cdn.anychart.com/releases/v8/js/anychart-base.min.js"></script>
  <script src="https://cdn.anychart.com/releases/v8/js/anychart-graph.min.js"></script>
  <script src="https://cdn.anychart.com/releases/v8/js/anychart-data-adapter.min.js"></script>
  <script src="https://cdn.anychart.com/releases/v8/js/anychart-ui.min.js"></script>
  <script src="https://cdn.anychart.com/releases/v8/js/anychart-exports.min.js"></script>

CSS

html, body, #container {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

.anychart-tooltip {
  width: 300px;
  background: white;
  color: black;
  box-shadow: 5px 5px 18px #333;
}

.anychart-tooltip h5 {
  text-align: center;
  margin: 5px 0;
}

.anychart-tooltip img {
  display: block;
  margin: 0 auto;
  max-height: 250px;
}

JavaScript

anychart.onDocumentReady(function () {
  // The data used in this sample can be obtained from the CDN
  anychart.data.loadJsonFile('https://cdn.anychart.com/samples-data/graph/network-graph/data.json', function (data) {
    // create graph chart
    var chart = anychart.graph(data);

    // Set the rest of your chart configurations here...

    // set container id for the chart
    chart.container('container');
    // initiate chart drawing
    chart.draw();
  });
});