Browse Source

修改默认值

han_v3
herenshan112 4 months ago
parent
commit
b764d10323
  1. 49
      src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/bar.vue
  2. 88
      src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/line.vue

49
src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/bar.vue

@ -38,15 +38,46 @@ const drawPictures = () => {
myChart.value = echarts.init(document.getElementById(props.uuid) as HTMLDivElement);
analyzeChartData({ tableKey: props.tableKey, chartId: props.uuid }).then((data) => {
console.log("火兔", data);
let optVal = data.data;
optVal.grid = {
left: "2%",
right: "2%",
bottom: "15%",
top: "15%",
containLabel: true,
};
myChart.value.setOption(optVal);
if (data.code == 0) {
let optVal = data.data;
optVal.grid = {
left: "2%",
right: "2%",
bottom: "15%",
top: "15%",
containLabel: true,
};
myChart.value.setOption(optVal);
} else {
myChart.value.setOption({
grid: {
left: "2%",
right: "2%",
bottom: "15%",
top: "15%",
containLabel: true,
},
xAxis: {
data: ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"],
},
yAxis: {},
legend: {
data: ["销量", "销量科技"],
},
series: [
{
name: "销量",
type: "bar",
data: [5, 20, 36, 10, 10, 20],
},
{
name: "销量科技",
type: "bar",
data: [15, 21, 26, 70, 18, 29],
},
],
});
}
});
// myChart.value.setOption({
// grid: {

88
src/views/sysworkflow/lowcodepage/appPage/appPageForm/echatesUnit/chart/line.vue

@ -36,49 +36,53 @@ const drawPie = () => {
);
analyzeChartData({ tableKey: props.tableKey, chartId: props.uuid }).then((data) => {
console.log("火兔", data);
let optVal = data.data;
optVal.grid = {
left: "2%",
right: "2%",
bottom: "15%",
top: "15%",
containLabel: true,
};
myChartPie.value.setOption(optVal);
if (data.code == 0) {
let optVal = data.data;
optVal.grid = {
left: "2%",
right: "2%",
bottom: "15%",
top: "15%",
containLabel: true,
};
myChartPie.value.setOption(optVal);
} else {
myChartPie.value.setOption({
grid: {
left: "2%",
right: "2%",
bottom: "5%",
top: "15%",
containLabel: true,
},
xAxis: {
type: "category",
data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
},
legend: {
data: ["销量", "销量科技"],
},
yAxis: {
type: "value",
},
series: [
{
name: "销量",
data: [820, 932, 901, 934, 1290, 1330, 1320],
type: "line",
smooth: true,
},
{
name: "销量科技",
data: [822, 942, 951, 4, 1290, 1330, 1320],
type: "line",
smooth: true,
},
],
});
}
});
// myChartPie.value.setOption({
// grid: {
// left: "2%",
// right: "2%",
// bottom: "5%",
// top: "15%",
// containLabel: true,
// },
// xAxis: {
// type: "category",
// data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
// },
// legend: {
// data: ["", ""],
// },
// yAxis: {
// type: "value",
// },
// series: [
// {
// name: "",
// data: [820, 932, 901, 934, 1290, 1330, 1320],
// type: "line",
// smooth: true,
// },
// {
// name: "",
// data: [822, 942, 951, 4, 1290, 1330, 1320],
// type: "line",
// smooth: true,
// },
// ],
// });
// console.log("---->", props);
}
};

Loading…
Cancel
Save