Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

pie chart in javascript

// Using chartjs. 
// https://www.chartjs.org/docs/latest/charts/doughnut.html#pie
const data = {
  labels: [
    'Red',
    'Blue',
    'Yellow'
  ],
  datasets: [{
    label: 'My First Dataset',
    data: [300, 50, 100],
    backgroundColor: [
      'rgb(255, 99, 132)',
      'rgb(54, 162, 235)',
      'rgb(255, 205, 86)'
    ],
    hoverOffset: 4
  }]
};

const config = {
  type: 'pie',
  data: data,
};
 
PREVIOUS NEXT
Tagged: #pie #chart #javascript
ADD COMMENT
Topic
Name
1+6 =