Fixed: BarChart to have a stepSize multiplier of 1 instead of auto (#163)

* Fixes the BarChart to have a stepSize multiplier of 1 instead of auto

* Moves the size to props as per Discord

* Adds the same behavior to StackedBarChart's
This commit is contained in:
Lagicrus
2021-06-08 10:56:25 +01:00
committed by GitHub
parent d965cb3c98
commit 52bff3d7bd
2 changed files with 26 additions and 6 deletions
@@ -16,10 +16,16 @@ class StackedBarChart extends Component {
maintainAspectRatio: false,
scales: {
x: {
stacked: true
stacked: true,
ticks: {
stepSize: this.props.stepSize
}
},
y: {
stacked: true
stacked: true,
ticks: {
stepSize: this.props.stepSize
}
}
},
plugins: {
@@ -63,11 +69,13 @@ class StackedBarChart extends Component {
StackedBarChart.propTypes = {
data: PropTypes.object.isRequired,
title: PropTypes.string.isRequired
title: PropTypes.string.isRequired,
stepSize: PropTypes.number
};
StackedBarChart.defaultProps = {
title: ''
title: '',
stepSize: 1
};
export default StackedBarChart;