mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 12:19:08 +02:00
c51d697d7f
* Use the correct area to clip when stacked scales are used * adds test cases * fix CI issue * apply review * Update .size-limit.cjs Co-authored-by: Jacco van den Berg <jaccoberg2281@gmail.com> Co-authored-by: Jacco van den Berg <jaccoberg2281@gmail.com>
110 lines
2.3 KiB
JavaScript
110 lines
2.3 KiB
JavaScript
module.exports = {
|
|
config: {
|
|
type: 'line',
|
|
data: {
|
|
datasets: [
|
|
{data: [{x: 1, y: 5}, {x: 2, y: 10}, {x: 3, y: 5}], borderColor: 'red'},
|
|
{data: [{x: 1, y: 5}, {x: 2, y: 10}, {x: 3, y: 5}], yAxisID: 'y1', xAxisID: 'x1', borderColor: 'green'},
|
|
{data: [{x: 1, y: 5}, {x: 2, y: 10}, {x: 3, y: 5}], yAxisID: 'y2', xAxisID: 'x2', borderColor: 'blue'},
|
|
],
|
|
labels: ['tick1', 'tick2', 'tick3']
|
|
},
|
|
options: {
|
|
plugins: false,
|
|
scales: {
|
|
x: {
|
|
type: 'linear',
|
|
position: 'bottom',
|
|
stack: '1',
|
|
offset: true,
|
|
bounds: 'data',
|
|
border: {
|
|
color: 'red'
|
|
},
|
|
ticks: {
|
|
autoSkip: false,
|
|
maxRotation: 0,
|
|
count: 3
|
|
}
|
|
},
|
|
x1: {
|
|
type: 'linear',
|
|
position: 'bottom',
|
|
stack: '1',
|
|
offset: true,
|
|
bounds: 'data',
|
|
border: {
|
|
color: 'green'
|
|
},
|
|
ticks: {
|
|
autoSkip: false,
|
|
maxRotation: 0,
|
|
count: 3
|
|
}
|
|
},
|
|
x2: {
|
|
type: 'linear',
|
|
position: 'bottom',
|
|
stack: '1',
|
|
offset: true,
|
|
bounds: 'data',
|
|
border: {
|
|
color: 'blue'
|
|
},
|
|
ticks: {
|
|
autoSkip: false,
|
|
maxRotation: 0,
|
|
count: 3
|
|
}
|
|
},
|
|
y: {
|
|
type: 'linear',
|
|
position: 'left',
|
|
stack: '1',
|
|
offset: true,
|
|
border: {
|
|
color: 'red'
|
|
},
|
|
ticks: {
|
|
precision: 0
|
|
},
|
|
max: 7
|
|
},
|
|
y1: {
|
|
type: 'linear',
|
|
position: 'left',
|
|
stack: '1',
|
|
offset: true,
|
|
border: {
|
|
color: 'green'
|
|
},
|
|
ticks: {
|
|
precision: 0
|
|
},
|
|
max: 7
|
|
},
|
|
y2: {
|
|
type: 'linear',
|
|
position: 'left',
|
|
stack: '1',
|
|
offset: true,
|
|
border: {
|
|
color: 'blue',
|
|
},
|
|
ticks: {
|
|
precision: 0
|
|
},
|
|
max: 7
|
|
}
|
|
}
|
|
}
|
|
},
|
|
options: {
|
|
spriteText: true,
|
|
canvas: {
|
|
height: 384,
|
|
width: 384
|
|
}
|
|
}
|
|
};
|