update
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user