This commit is contained in:
duanxiaohai 2024-05-16 13:54:11 +08:00
parent 79afe8d56f
commit 520afc5132
1 changed files with 12 additions and 7 deletions

View File

@ -39,11 +39,16 @@ const data = reactive({
// const lb = ref(0); // const lb = ref(0);
const getOption1 = () => { const getOption1 = () => {
// data.list = []
data.list.forEach((item,index) => {
data.list1.push([item]);
});
console.log(data.list,666);
// data.list.forEach((item,index) => { // data.list.forEach((item,index) => {
// data.total += item[index]; // data.total += item[index];
// }); // // }); //
data.totalMax = data.total * 1.06; // // data.totalMax = data.total * 1.06; //
data.lb = Math.trunc(data.total * 0.03);// // data.lb = Math.trunc(data.total * 0.03);//
}; };
const getOption = () => { const getOption = () => {
console.log(data.list, 111); console.log(data.list, 111);
@ -88,7 +93,7 @@ const getOption = () => {
series: [ series: [
{ {
type: "bar", type: "bar",
data: data.lb, data: [data.lb],
stack: "income", stack: "income",
barWidth: 18, barWidth: 18,
itemStyle: { itemStyle: {
@ -227,7 +232,7 @@ const getOption = () => {
}, },
{ {
type: "bar", type: "bar",
data: data.lb, data: [data.lb],
stack: "income", stack: "income",
barWidth: 18, barWidth: 18,
itemStyle: { itemStyle: {
@ -244,7 +249,7 @@ const getOption = () => {
color: "rgba(255,255,255,0.1)", color: "rgba(255,255,255,0.1)",
barBorderRadius: [100, 100, 100, 100], barBorderRadius: [100, 100, 100, 100],
}, },
data: ["2019"].map(() => data.totalMax), data: ["2019"].map(() => 106),
barWidth: 50, barWidth: 50,
}, },
], ],
@ -259,8 +264,8 @@ const setChart = () => {
// 使 // 使
onBeforeMount(() => { onBeforeMount(() => {
setTimeout(() => { setTimeout(() => {
// data.list = props.list; data.list = props.list;
// getOption1(); getOption1();
getOption(); getOption();
setChart(); setChart();
}, 600); }, 600);