take an array of objects and put it in a bar graph
<p>i am a new when it comes to jquery and javascript but I'm trying learn slowly.What my question is, if i have a json file that looks like              </p>

<pre><code>   var data=  [{"tasknumber":304030,
   "date":"2012-05-05",
   "operator":"john doe"},
  {"tasknumber":23130,
   "date":"2012-07-07",
   "operator":"john doeeeeeeee"},
   {"tasknumber":233330,
   "date":"2012-08-08",
   "operator":"john doe"}]
</code></pre>

<p>and i applied .countBy to it from the underscore library to get a array that looks like this</p>

<pre><code>{"john doe":2,"john doeeeeeeee":1}
</code></pre>

<p>so for the next part im using a sample jquery graph outline which i found online</p>

<pre><code>&lt;!DOCTYPE HTML&gt;
&lt;html&gt;
&lt;head&gt;
&lt;script src="http://canvasjs.com/assets/script/canvasjs.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;

window.onload = function () {
    var chart = new CanvasJS.Chart("chartContainer", {
        title:{
            text: "My First Chart in CanvasJS"              
        },
        data: [              
        {
            // Change type to "doughnut", "line", "splineArea", etc.
            type: "column",
            dataPoints: [
                { label: "apple",  y: 10  },
                { label: "orange", y: 15  },
                { label: "banana", y: 25  },
                { label: "mango",  y: 30  },
                { label: "grape",  y: 28  }
            ]
        }
        ]
    });
    chart.render();
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id="chartContainer" style="height: 300px; width: 100%;"&gt;&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>I tried a couple ways to call my new array within this part of the code</p>

<pre><code>data: [              
        {
            // Change type to "doughnut", "line", "splineArea", etc.
            type: "column",
            dataPoints: [
                //insert here
            ]
        }
        ]
</code></pre>

<p>but i only get blank screens and undefine when i try and open it.does anyone have any guidance for me on how to call my array within the datapoints?</p>

<p>my data is in a different file called task.json and i gotta call it using</p>

<pre><code>var input=require('./task.json');
const _ = require(`underscore`);
var names=_.countBy(input,'operator');
</code></pre>