refactor: colours in queue chart

This commit is contained in:
Johann150 2022-07-23 23:00:59 +02:00
parent 2f432dce65
commit 63591da33e
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1

View file

@ -42,14 +42,6 @@ Chart.register(
Filler, Filler,
); );
const alpha = (hex, a) => {
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex)!;
const r = parseInt(result[1], 16);
const g = parseInt(result[2], 16);
const b = parseInt(result[3], 16);
return `rgba(${r}, ${g}, ${b}, ${a})`;
};
export default defineComponent({ export default defineComponent({
props: { props: {
domain: { domain: {
@ -81,7 +73,7 @@ export default defineComponent({
borderWidth: 2, borderWidth: 2,
borderJoinStyle: 'round', borderJoinStyle: 'round',
borderColor: '#00E396', borderColor: '#00E396',
backgroundColor: alpha('#00E396', 0.1), backgroundColor: '#00E3961A',
data: [] data: []
}, { }, {
label: 'Active', label: 'Active',
@ -90,7 +82,7 @@ export default defineComponent({
borderWidth: 2, borderWidth: 2,
borderJoinStyle: 'round', borderJoinStyle: 'round',
borderColor: '#00BCD4', borderColor: '#00BCD4',
backgroundColor: alpha('#00BCD4', 0.1), backgroundColor: '#00BCD41A',
data: [] data: []
}, { }, {
label: 'Waiting', label: 'Waiting',
@ -99,7 +91,7 @@ export default defineComponent({
borderWidth: 2, borderWidth: 2,
borderJoinStyle: 'round', borderJoinStyle: 'round',
borderColor: '#FFB300', borderColor: '#FFB300',
backgroundColor: alpha('#FFB300', 0.1), backgroundColor: '#FFB3001A',
yAxisID: 'y2', yAxisID: 'y2',
data: [] data: []
}, { }, {
@ -130,7 +122,7 @@ export default defineComponent({
grid: { grid: {
display: true, display: true,
color: gridColor, color: gridColor,
borderColor: 'rgb(0, 0, 0, 0)', borderColor: '#0000',
}, },
ticks: { ticks: {
display: false, display: false,
@ -143,7 +135,7 @@ export default defineComponent({
stackWeight: 2, stackWeight: 2,
grid: { grid: {
color: gridColor, color: gridColor,
borderColor: 'rgb(0, 0, 0, 0)', borderColor: '#0000',
}, },
}, },
y2: { y2: {
@ -153,7 +145,7 @@ export default defineComponent({
stackWeight: 1, stackWeight: 1,
grid: { grid: {
color: gridColor, color: gridColor,
borderColor: 'rgb(0, 0, 0, 0)', borderColor: '#0000',
}, },
}, },
}, },