A bar chart or bar graph is a chart with rectangular bars with lengths proportional to the values that they represent.
A bar chart or bar graph is a chart with rectangular bars with lengths proportional to the values that they represent.
Javascript Code
var ctx = document.getElementById('chartBar1').getContext('2d');
new Chart(ctx, {
type: 'bar',
data: {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'],
datasets: [{
label: '# of Votes',
data: [12, 39, 20, 10, 25, 18],
backgroundColor: '#27AAC8'
}]
},
options: {
legend: {
display: false,
labels: {
display: false
}
},
scales: {
yAxes: [{
ticks: {
beginAtZero:true,
fontSize: 10,
max: 80
}
}],
xAxes: [{
ticks: {
beginAtZero:true,
fontSize: 11
}
}]
}
}
});
Multiple Color Code
backgroundColor: [
'#29B0D0',
'#2A516E',
'#F07124',
'#CBE0E3',
'#979193'
]
A bar chart or bar graph is a chart with rectangular bars with lengths proportional to the values that they represent.
A bar chart or bar graph is a chart with rectangular bars with lengths proportional to the values that they represent.
Horizontal Type Code
type: 'horizontalBar'
A bar chart or bar graph is a chart with rectangular bars with lengths proportional to the values that they represent.
A bar chart or bar graph is a chart with rectangular bars with lengths proportional to the values that they represent.
Source Code
scales: {
yAxes: [{
stacked: true
}],
xAxes: [{
stacked: true
}]
}
A line graph is a type of chart which displays information as a series of data points connected by straight line segments.
A line graph is a type of chart which displays information as a series of data points connected by straight line segments.
Source Code
type: 'line'
An area chart or area graph displays graphically quantitative data. It is based on the line chart.
An area chart or area graph displays graphically quantitative data. It is based on the line chart.
Source Code
datasets: [{
data: [12, 39, 20, 10, 25, 18],
fill: true,
}]
A pie chart (or a circle chart) is a circular statistical graphic which is divided into slices to illustrate numerical proportion.
Source Code
var pie = document.getElementById('chartDonut');
var myPieChart = new Chart(pie, {
type: 'pie',
data: data,
options: option
});
A pie chart (or a circle chart) is a circular statistical graphic which is divided into slices to illustrate numerical proportion.
Source Code
var pie = document.getElementById('chartDonut');
var myPieChart = new Chart(pie, {
type: 'doughnut',
data: data,
options: option
});