</p><pre><code class="language-javascript">labels:[“CS”, “IT” , “ECE” , “EE”, ”ME”, “BE”],
And datasets:
Label: ‘# of students’,
Data : [105,124,78,91,62,56],
backgroundColor :['rgba(255, 99, 132, 0.2)',
'rgba(54, 162, 235, 0.2)',
'rgba(255, 206, 86, 0.2)',
'rgba(75, 192, 192, 0.2)',
'rgba(153, 102, 255, 0.2)',
'rgba(255, 159, 64, 0.2)'
],
borderColor: [
'rgba(255,99,132,1)',
'rgba(54, 162, 235, 1)',
'rgba(255, 206, 86, 1)',
'rgba(75, 192, 192, 1)',
'rgba(153, 102, 255, 1)',
'rgba(255, 159, 64, 1)'
]</code></pre><span>And finally, we should decide the type of chart from a line, bar, radar, pie, doughnut, polar area, bubble and scatter. </span><p></p><h3><b><strong>Create a graph:</strong></b><span> </span></h3><p dir="ltr"><span>After defining what type of graph is to be drawn, pass the data to that graph that we want to visualize. Below is an example: </span><gfg-tabs data-run-ide="false" data-mode="light"><gfg-tab slot="tab">javascript