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

qianming 1 year ago
parent 3ef94ec900
commit 5ec8feaa54

@ -411,6 +411,22 @@ export const widgetBarStack = {
placeholder: '', placeholder: '',
value: true, 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', type: 'el-input-text',
label: '坐标名', label: '坐标名',

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

Loading…
Cancel
Save