feat--柱状堆叠图优化-增加Y轴最大值和阴影

qianming 11 months ago
parent 3ef94ec900
commit 5ec8feaa54

@ -411,6 +411,22 @@ export const widgetBarStack = {
placeholder: '',
value: true,
},
{
type: 'el-input-text',
label: '最大值',
name: 'maxY',
required: false,
placeholder: '',
value: '100',
},
{
type: 'el-switch',
label: '阴影显示',
name: 'isShowBackground',
require: false,
placeholder: '',
value: true,
},
{
type: 'el-input-text',
label: '坐标名',

@ -1,6 +1,6 @@
<template>
<div :style="styleObj">
<v-chart ref="myVChart" :options="options" autoresize />
<v-chart ref="myVChart" :options="options" autoresize/>
</div>
</template>
@ -173,10 +173,20 @@ export default {
};
this.options.xAxis = xAxis;
},
//yAxis maxnull
getOptionsYMax() {
const optionsSetup = this.optionsSetup;
let max = null;
if (optionsSetup.maxY !== "") {
max = optionsSetup.maxY
}
return max
},
// Y
setOptionsY() {
const optionsSetup = this.optionsSetup;
const yAxis = {
max: this.getOptionsYMax(),
type: "value",
scale: optionsSetup.scale,
//
@ -357,6 +367,7 @@ export default {
}
series.push({
name: yAxisList[i],
showBackground: optionsSetup.isShowBackground,
type: "bar",
data: data,
barGap: "0%",

Loading…
Cancel
Save