JSFiddle - React, Tailwind, and code Playground

HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://canvasjs.com/assets/script/canvasjs.min.js"></script>
<div id="chartContainer" style="height: 360px; width: 100%;"></div>

JavaScript

//window.onload = function() {
	// window.onload won't be required if the Load Type is set to onload in jsFiddle.
  
  //var dataPoints = [];
  // fetching the json data from api via AJAX call.
  var X = [];
  var Y = [];
  var data = [];

  function loadJSON(callback) {
    var xobj = new XMLHttpRequest();
    xobj.overrideMimeType("application/json");
    xobj.open('GET', 'https://api.myjson.com/bins/cixax', true);
    xobj.onreadystatechange = function() {
      if (xobj.readyState == 4 && xobj.status == "200") {
        callback(xobj.responseText);
      }
    }
    xobj.send(null);
  }
  loadJSON(function(response) {
    var response;
    var field = JSON.parse(response);
    var values = [];
    //Iterating and storing leads & visits in a variable.
    var $this = field;
    for (var key in $this) {
      if ($this.hasOwnProperty(key)) {
        var data = $this[key].dates;
        for (var val in data) {
          values.push({
            "x": data[val].visits, // Should be "x" & "y"
            "y": data[val].leads 
          });
        }
      }
    }
    //dataPoints = ({
    //  "values": values
    //});
    
    // Update the dataPoints & render the chart
    // x values need to be in sorted order
    chart.options.data[0].dataPoints = values;
    
 // convertToLog() is changing some of the y Values to Negative,generally which should not be present in log scale.
 
    //convertToLog(chart.options.data); 
    chart.render();
  });

  var chart = new CanvasJS.Chart("chartContainer", {
    title: {
      text: "Log Scale on Axis Y - Workaround using Linear Axis"
    },
    axisY: {
      //valueFormatString: "0.## E0",
      title: "In log scale",
      labelFormatter: function(e) {
        var lable = Math.pow(10, e.value);
        if (lable >= 1000)
          lable = CanvasJS.formatNumber(lable / 1000) + "k";
        else
          lable = CanvasJS.formatNumber(lable);
        return lable;
      },
      interval: 1,
      includeZero: false
   ...