mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-09 05:39:06 +02:00
021561072b
Disabling all plugins when options.plugins = false
57 lines
794 B
JavaScript
57 lines
794 B
JavaScript
var date = moment('May 24 2020', 'MMM DD YYYY');
|
|
|
|
module.exports = {
|
|
threshold: 0.05,
|
|
config: {
|
|
type: 'bar',
|
|
data: {
|
|
datasets: [{
|
|
backgroundColor: 'rgba(255, 0, 0, 0.5)',
|
|
data: [
|
|
{
|
|
x: date.clone().add(-2, 'day'),
|
|
y: 20,
|
|
},
|
|
{
|
|
x: date.clone().add(-1, 'day'),
|
|
y: 30,
|
|
},
|
|
{
|
|
x: date,
|
|
y: 40,
|
|
},
|
|
{
|
|
x: date.clone().add(1, 'day'),
|
|
y: 50,
|
|
},
|
|
{
|
|
x: date.clone().add(7, 'day'),
|
|
y: 10,
|
|
}
|
|
]
|
|
}]
|
|
},
|
|
options: {
|
|
scales: {
|
|
x: {
|
|
display: false,
|
|
type: 'time',
|
|
distribution: 'linear',
|
|
ticks: {
|
|
source: 'auto'
|
|
},
|
|
time: {
|
|
unit: 'day'
|
|
}
|
|
},
|
|
y: {
|
|
display: false
|
|
}
|
|
}
|
|
}
|
|
},
|
|
options: {
|
|
spriteText: true
|
|
}
|
|
};
|