This commit is contained in:
lb
2023-12-29 11:06:07 +08:00
parent 3f44cb9e9a
commit a73d61fad8
4 changed files with 115 additions and 10 deletions

View File

@@ -85,18 +85,31 @@ function preHandleStatisticData(data, legend) {
data: [],
}));
const seriesData = [];
legend.forEach((item, index) => {
series[index].name = item;
data.forEach((d, idx) => {
// if (index == 0) {
// series[index].label = {
if (index == legend.length - 1) {
series[index].label = {
show: true,
position: "top",
distance: 10,
color: "#fffc",
formatter: (params) => data[params.dataIndex].sum,
};
}
// const sum = d.sum;
// console.log("d", d, sum);
// series[index].label = ((fff) => {
// console.log("===>", fff);
// return {
// show: true,
// position: "top",
// distance: 10,
// color: "#fffc",
// formatter: "asdf" + fff,
// };
// }
// })(sum);
series[index].data.push(obj[d.name][item] || 0);
});
});
@@ -107,9 +120,10 @@ function preHandleStatisticData(data, legend) {
function getOptions(series, isra, currentStatistic) {
return {
color: ["#2760FF", "#8167F6", "#5B9BFF", "#99D66C", "#FFD160", "#FF8A40"],
grid: { top: 42, right: 12, bottom: 20, left: 48 },
grid: { top: 80, right: 12, bottom: 20, left: 48 },
legend: {
top: 10,
left: 60,
padding: 5,
itemWidth: 12,
itemHeight: 12,