|
|
|
@ -15,7 +15,8 @@ export function VerticalBarChart({data = [], labels = []}) { |
|
|
|
|
maxValue = item; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
// labels = labels?.map((item) => item.replace('Tuần', 'W'));
|
|
|
|
|
|
|
|
|
|
labels = labels?.map(week => week.split(" ")); |
|
|
|
|
|
|
|
|
|
const options = { |
|
|
|
|
responsive: true, |
|
|
|
@ -24,15 +25,21 @@ export function VerticalBarChart({data = [], labels = []}) { |
|
|
|
|
legend: { |
|
|
|
|
display: false |
|
|
|
|
}, |
|
|
|
|
// title: {
|
|
|
|
|
// display: true,
|
|
|
|
|
// text: 'Tuần',
|
|
|
|
|
// align: 'start',
|
|
|
|
|
// position: 'bottom',
|
|
|
|
|
// },
|
|
|
|
|
datalabels: { |
|
|
|
|
anchor: 'end', // Position of the labels (start, end, center, etc.)
|
|
|
|
|
align: 'end', // Alignment of the labels (start, end, center, etc.)
|
|
|
|
|
color: 'blue', // Color of the labels
|
|
|
|
|
anchor: 'end', |
|
|
|
|
align: 'end', |
|
|
|
|
color: 'blue', |
|
|
|
|
font: { |
|
|
|
|
weight: 'bold', |
|
|
|
|
}, |
|
|
|
|
formatter: function (value, context) { |
|
|
|
|
return value; // Display the actual data value
|
|
|
|
|
return value; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
@ -40,7 +47,6 @@ export function VerticalBarChart({data = [], labels = []}) { |
|
|
|
|
x: { |
|
|
|
|
ticks: { |
|
|
|
|
maxRotation: 0, |
|
|
|
|
// scrollX : true,
|
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
y: { |
|
|
|
|