mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 12:19:08 +02:00
Bar chart defaults to begin at zero (#6917)
* Bar chart defaults to begin at zero * Add bar beginAtZero test
This commit is contained in:
parent
5f6c3df6dc
commit
b464999851
@ -22,6 +22,7 @@ defaults._set('bar', {
|
||||
},
|
||||
y: {
|
||||
type: 'linear',
|
||||
beginAtZero: true,
|
||||
}
|
||||
}
|
||||
});
|
||||
|
29
test/fixtures/controller.bar/bar-default-begin-at-zero.js
vendored
Normal file
29
test/fixtures/controller.bar/bar-default-begin-at-zero.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
module.exports = {
|
||||
config: {
|
||||
type: 'bar',
|
||||
data: {
|
||||
labels: [0, 1, 3, 4],
|
||||
datasets: [
|
||||
{
|
||||
data: [5, 20, 1, 10],
|
||||
backgroundColor: '#00ff00',
|
||||
borderColor: '#ff0000'
|
||||
}
|
||||
]
|
||||
},
|
||||
options: {
|
||||
legend: false,
|
||||
title: false,
|
||||
scales: {
|
||||
x: {display: false},
|
||||
y: {display: false}
|
||||
}
|
||||
}
|
||||
},
|
||||
options: {
|
||||
canvas: {
|
||||
height: 256,
|
||||
width: 512
|
||||
}
|
||||
}
|
||||
};
|
BIN
test/fixtures/controller.bar/bar-default-begin-at-zero.png
vendored
Normal file
BIN
test/fixtures/controller.bar/bar-default-begin-at-zero.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.8 KiB |
@ -708,7 +708,8 @@ describe('Chart.controllers.bar', function() {
|
||||
},
|
||||
y: {
|
||||
type: 'linear',
|
||||
display: false
|
||||
display: false,
|
||||
beginAtZero: false
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -773,7 +774,8 @@ describe('Chart.controllers.bar', function() {
|
||||
},
|
||||
y: {
|
||||
type: 'linear',
|
||||
display: false
|
||||
display: false,
|
||||
beginAtZero: false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -210,7 +210,8 @@ describe('Linear Scale', function() {
|
||||
options: {
|
||||
scales: {
|
||||
y: {
|
||||
type: 'linear'
|
||||
type: 'linear',
|
||||
beginAtZero: false
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -673,6 +674,7 @@ describe('Linear Scale', function() {
|
||||
scales: {
|
||||
y: {
|
||||
type: 'linear',
|
||||
beginAtZero: false
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -751,7 +753,9 @@ describe('Linear Scale', function() {
|
||||
},
|
||||
options: {
|
||||
scales: {
|
||||
y: {}
|
||||
y: {
|
||||
beginAtZero: false
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user