2020-10-28 16:28:17 +01:00
|
|
|
module.exports = {
|
|
|
|
config: {
|
|
|
|
type: 'line',
|
|
|
|
data: {
|
|
|
|
datasets: [
|
|
|
|
{data: [10, 5, 0, 25, 78, -10]}
|
|
|
|
],
|
|
|
|
labels: ['tick1', 'tick2', 'tick3', 'tick4', 'tick5', 'tick6']
|
|
|
|
},
|
|
|
|
options: {
|
|
|
|
layout: {
|
|
|
|
padding: function(ctx) {
|
|
|
|
// 10% padding
|
|
|
|
const horizontalPadding = ctx.chart.width * 0.1;
|
|
|
|
const verticalPadding = ctx.chart.height * 0.1;
|
|
|
|
return {
|
|
|
|
top: verticalPadding,
|
|
|
|
right: horizontalPadding,
|
|
|
|
bottom: verticalPadding,
|
|
|
|
left: horizontalPadding
|
|
|
|
};
|
|
|
|
}
|
|
|
|
},
|
2020-11-25 07:50:12 +01:00
|
|
|
plugins: {
|
|
|
|
legend: false
|
2020-10-28 16:28:17 +01:00
|
|
|
},
|
|
|
|
scales: {
|
|
|
|
x: {
|
|
|
|
type: 'category',
|
|
|
|
ticks: {
|
|
|
|
maxRotation: 0,
|
|
|
|
autoSkip: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
y: {
|
|
|
|
type: 'linear',
|
|
|
|
position: 'right'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
options: {
|
|
|
|
spriteText: true,
|
|
|
|
canvas: {
|
|
|
|
height: 150,
|
|
|
|
width: 512
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|