This commit is contained in:
parent
79afe8d56f
commit
520afc5132
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue