feat--柱状图增加配置项

qianming 1 year ago
parent 0237f76f3c
commit 27fc7f58b2

@ -51,6 +51,75 @@ export const widgetBarCompare = {
placeholder: '',
value: 5,
},
{
type: 'el-switch',
label: '背景显示',
name: 'isShowBackground',
require: false,
placeholder: '',
value: true,
},
{
type: 'vue-color',
label: '背景颜色',
name: 'backgroundStyleColor',
required: false,
placeholder: '',
value: 'rgba(180, 180, 180, 0.2)',
},
{
type: 'vue-color',
label: '描边颜色',
name: 'backgroundStyleBorderColor',
required: false,
placeholder: '',
value: '#000',
},
{
type: 'el-input-number',
label: '描边宽度',
name: 'backgroundStyleBorderWidth',
required: false,
placeholder: '',
value: 0,
},
{
type: 'el-select',
label: '描边类型',
name: 'backgroundStyleBorderType',
required: false,
placeholder: '',
selectOptions: [
{ code: 'solid', name: '实线' },
{ code: 'dashed', name: '虚线' },
{ code: 'dotted', name: '斑点' },
],
value: 'dashed'
},
{
type: 'el-input-number',
label: '阴影模糊',
name: 'backgroundStyleShadowBlur',
required: false,
placeholder: '',
value: 10,
},
{
type: 'vue-color',
label: '阴影颜色',
name: 'backgroundStyleShadowColor',
required: false,
placeholder: '',
value: 'rgba(0, 0, 0, 0.5)',
},
{
type: 'el-slider',
label: '透明度',
name: 'backgroundStyleOpacity',
require: false,
placeholder: '',
value: 100,
},
],
},
{
@ -274,6 +343,14 @@ export const widgetBarCompare = {
placeholder: '',
value: true,
},
{
type: 'el-input-text',
label: '最大值',
name: 'maxXLeft',
required: false,
placeholder: '',
value: '',
},
{
type: 'el-input-number',
label: '数值间隔',
@ -395,6 +472,14 @@ export const widgetBarCompare = {
placeholder: '',
value: true,
},
{
type: 'el-input-text',
label: '最大值',
name: 'maxXRight',
required: false,
placeholder: '',
value: '',
},
{
type: 'el-input-number',
label: '数值间隔',

@ -52,6 +52,75 @@ export const widgetBarDoubleYaxis = {
placeholder: '',
value: 0,
},
{
type: 'el-switch',
label: '背景显示',
name: 'isShowBackground',
require: false,
placeholder: '',
value: true,
},
{
type: 'vue-color',
label: '背景颜色',
name: 'backgroundStyleColor',
required: false,
placeholder: '',
value: 'rgba(180, 180, 180, 0.2)',
},
{
type: 'vue-color',
label: '描边颜色',
name: 'backgroundStyleBorderColor',
required: false,
placeholder: '',
value: '#000',
},
{
type: 'el-input-number',
label: '描边宽度',
name: 'backgroundStyleBorderWidth',
required: false,
placeholder: '',
value: 0,
},
{
type: 'el-select',
label: '描边类型',
name: 'backgroundStyleBorderType',
required: false,
placeholder: '',
selectOptions: [
{ code: 'solid', name: '实线' },
{ code: 'dashed', name: '虚线' },
{ code: 'dotted', name: '斑点' },
],
value: 'dashed'
},
{
type: 'el-input-number',
label: '阴影模糊',
name: 'backgroundStyleShadowBlur',
required: false,
placeholder: '',
value: 10,
},
{
type: 'vue-color',
label: '阴影颜色',
name: 'backgroundStyleShadowColor',
required: false,
placeholder: '',
value: 'rgba(0, 0, 0, 0.5)',
},
{
type: 'el-slider',
label: '透明度',
name: 'backgroundStyleOpacity',
require: false,
placeholder: '',
value: 100,
},
],
},
{
@ -392,6 +461,14 @@ export const widgetBarDoubleYaxis = {
placeholder: '',
value: true,
},
{
type: 'el-input-text',
label: '最大值',
name: 'maxYLeft',
required: false,
placeholder: '',
value: '',
},
{
type: 'el-input-text',
label: '坐标名',
@ -517,6 +594,14 @@ export const widgetBarDoubleYaxis = {
placeholder: '',
value: true,
},
{
type: 'el-input-text',
label: '最大值',
name: 'maxYRight',
required: false,
placeholder: '',
value: '',
},
{
type: 'el-input-text',
label: '坐标名',

@ -486,7 +486,7 @@ export const widgetBarStack = {
name: 'maxY',
required: false,
placeholder: '',
value: '100',
value: '',
},
{
type: 'el-input-text',

@ -79,6 +79,75 @@ export const widgetBarchart = {
],
value: 'leftRight'
},
{
type: 'el-switch',
label: '背景显示',
name: 'isShowBackground',
require: false,
placeholder: '',
value: true,
},
{
type: 'vue-color',
label: '背景颜色',
name: 'backgroundStyleColor',
required: false,
placeholder: '',
value: 'rgba(180, 180, 180, 0.2)',
},
{
type: 'vue-color',
label: '描边颜色',
name: 'backgroundStyleBorderColor',
required: false,
placeholder: '',
value: '#000',
},
{
type: 'el-input-number',
label: '描边宽度',
name: 'backgroundStyleBorderWidth',
required: false,
placeholder: '',
value: 0,
},
{
type: 'el-select',
label: '描边类型',
name: 'backgroundStyleBorderType',
required: false,
placeholder: '',
selectOptions: [
{ code: 'solid', name: '实线' },
{ code: 'dashed', name: '虚线' },
{ code: 'dotted', name: '斑点' },
],
value: 'dashed'
},
{
type: 'el-input-number',
label: '阴影模糊',
name: 'backgroundStyleShadowBlur',
required: false,
placeholder: '',
value: 10,
},
{
type: 'vue-color',
label: '阴影颜色',
name: 'backgroundStyleShadowColor',
required: false,
placeholder: '',
value: 'rgba(0, 0, 0, 0.5)',
},
{
type: 'el-slider',
label: '透明度',
name: 'backgroundStyleOpacity',
require: false,
placeholder: '',
value: 100,
},
],
},
{
@ -419,6 +488,14 @@ export const widgetBarchart = {
placeholder: '',
value: true,
},
{
type: 'el-input-text',
label: '最大值',
name: 'maxY',
required: false,
placeholder: '',
value: '',
},
{
type: 'el-input-text',
label: '坐标名',

@ -59,6 +59,75 @@ export const widgetGradientBarchart = {
placeholder: '',
value: 5,
},
{
type: 'el-switch',
label: '背景显示',
name: 'isShowBackground',
require: false,
placeholder: '',
value: true,
},
{
type: 'vue-color',
label: '背景颜色',
name: 'backgroundStyleColor',
required: false,
placeholder: '',
value: 'rgba(180, 180, 180, 0.2)',
},
{
type: 'vue-color',
label: '描边颜色',
name: 'backgroundStyleBorderColor',
required: false,
placeholder: '',
value: '#000',
},
{
type: 'el-input-number',
label: '描边宽度',
name: 'backgroundStyleBorderWidth',
required: false,
placeholder: '',
value: 0,
},
{
type: 'el-select',
label: '描边类型',
name: 'backgroundStyleBorderType',
required: false,
placeholder: '',
selectOptions: [
{code: 'solid', name: '实线'},
{code: 'dashed', name: '虚线'},
{code: 'dotted', name: '斑点'},
],
value: 'dashed'
},
{
type: 'el-input-number',
label: '阴影模糊',
name: 'backgroundStyleShadowBlur',
required: false,
placeholder: '',
value: 10,
},
{
type: 'vue-color',
label: '阴影颜色',
name: 'backgroundStyleShadowColor',
required: false,
placeholder: '',
value: 'rgba(0, 0, 0, 0.5)',
},
{
type: 'el-slider',
label: '透明度',
name: 'backgroundStyleOpacity',
require: false,
placeholder: '',
value: 100,
},
],
},
{
@ -317,6 +386,14 @@ export const widgetGradientBarchart = {
placeholder: '',
value: true,
},
{
type: 'el-input-text',
label: '最大值',
name: 'maxY',
required: false,
placeholder: '',
value: '',
},
{
type: 'el-input-text',
label: '坐标名',

@ -324,6 +324,7 @@ export default {
setOptionsXLeft() {
const optionsSetup = this.optionsSetup;
const xAxisLeft = {
max: optionsSetup.maxXLeft !== "" ? optionsSetup.maxXLeft : null,
splitNumber: optionsSetup.splitNumberLeft,
type: "value",
show: optionsSetup.hideXLeft,
@ -363,6 +364,7 @@ export default {
setOptionsXRight() {
const optionsSetup = this.optionsSetup;
const xAxisRight = {
max: optionsSetup.maxXRight !== "" ? optionsSetup.maxXRight : null,
gridIndex: 2,
splitNumber: optionsSetup.splitNumberRight,
show: optionsSetup.hideXRight,
@ -426,9 +428,7 @@ export default {
setOptionsTop() {
const optionsSetup = this.optionsSetup;
const series = this.options.series;
for (const key in series) {
if (series[key].type == "bar") {
(series[0].label = {
series[0].label = {
normal: {
show: optionsSetup.isShow,
position: "insideLeft",
@ -441,8 +441,8 @@ export default {
emphasis: {
show: false,
},
}),
(series[1].label = {
};
series[1].label = {
normal: {
show: optionsSetup.isShow,
color: "red",
@ -456,9 +456,20 @@ export default {
emphasis: {
show: false,
},
}),
(series[key].barWidth = optionsSetup.maxWidth);
}
};
for (const key in series) {
series[key].barWidth = optionsSetup.maxWidth;
//
series[key].showBackground = optionsSetup.isShowBackground;
series[key].backgroundStyle = {
color: optionsSetup.backgroundStyleColor,
borderColor: optionsSetup.backgroundStyleBorderColor,
borderWidth: optionsSetup.backgroundStyleBorderWidth,
borderType: optionsSetup.backgroundStyleBorderType,
shadowBlur: optionsSetup.backgroundStyleShadowBlur,
shadowColor: optionsSetup.backgroundStyleShadowColor,
opacity: optionsSetup.backgroundStyleOpacity / 100,
};
}
this.options.series = series;
},

@ -219,6 +219,7 @@ export default {
const optionsSetup = this.optionsSetup;
const yAxis = [
{
max: optionsSetup.maxYLeft !== "" ? optionsSetup.maxYLeft : null,
type: "value",
//
splitNumber: optionsSetup.splitNumberLeft,
@ -261,6 +262,7 @@ export default {
},
},
{
max: optionsSetup.maxYRight !== "" ? optionsSetup.maxYRight : null,
type: "value",
//
splitNumber: optionsSetup.splitNumberRight,
@ -322,6 +324,17 @@ export default {
series[key].barWidth = optionsSetup.maxWidth;
series[key].barMinHeight = optionsSetup.minHeight;
series[key].itemStyle.barBorderRadius = optionsSetup.radius;
//
series[key].showBackground = optionsSetup.isShowBackground;
series[key].backgroundStyle = {
color: optionsSetup.backgroundStyleColor,
borderColor: optionsSetup.backgroundStyleBorderColor,
borderWidth: optionsSetup.backgroundStyleBorderWidth,
borderType: optionsSetup.backgroundStyleBorderType,
shadowBlur: optionsSetup.backgroundStyleShadowBlur,
shadowColor: optionsSetup.backgroundStyleShadowColor,
opacity: optionsSetup.backgroundStyleOpacity / 100,
};
}
}
this.options.series = series;

@ -173,20 +173,11 @@ 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(),
max: optionsSetup.maxY !== "" ? optionsSetup.maxY : null,
type: "value",
scale: optionsSetup.scale,
//
@ -402,7 +393,6 @@ export default {
});
legendName.push(yAxisList[i]);
}
console.log(series)
this.options.series = series;
if (optionsSetup.verticalShow) {
this.options.xAxis.data = [];

@ -184,6 +184,7 @@ export default {
setOptionsY() {
const optionsSetup = this.optionsSetup;
const yAxis = {
max: optionsSetup.maxY !== "" ? optionsSetup.maxY : null,
type: "value",
scale: optionsSetup.scale,
//
@ -391,6 +392,17 @@ export default {
},
};
}
//
series[i].showBackground = optionsSetup.isShowBackground;
series[i].backgroundStyle = {
color: optionsSetup.backgroundStyleColor,
borderColor: optionsSetup.backgroundStyleBorderColor,
borderWidth: optionsSetup.backgroundStyleBorderWidth,
borderType: optionsSetup.backgroundStyleBorderType,
shadowBlur: optionsSetup.backgroundStyleShadowBlur,
shadowColor: optionsSetup.backgroundStyleShadowColor,
opacity: optionsSetup.backgroundStyleOpacity / 100,
};
series[i].data = data;
}
}
@ -475,6 +487,17 @@ export default {
},
};
}
//
obj.showBackground = optionsSetup.isShowBackground;
obj.backgroundStyle = {
color: optionsSetup.backgroundStyleColor,
borderColor: optionsSetup.backgroundStyleBorderColor,
borderWidth: optionsSetup.backgroundStyleBorderWidth,
borderType: optionsSetup.backgroundStyleBorderType,
shadowBlur: optionsSetup.backgroundStyleShadowBlur,
shadowColor: optionsSetup.backgroundStyleShadowColor,
opacity: optionsSetup.backgroundStyleOpacity / 100,
}
obj.data = val.series[i].data;
series.push(obj);
}

@ -10,6 +10,7 @@ import {
targetWidgetLinkageLogic,
} from "@/views/bigscreenDesigner/designer/linkageLogic";
import echarts from "echarts";
export default {
name: "WidgetGradientColorBarchart", //https://www.makeapie.com/editor.html?c=x0oZWoncE
components: {},
@ -260,6 +261,7 @@ export default {
setOptionsY() {
const optionsSetup = this.optionsSetup;
const yAxis = {
max: optionsSetup.maxY !== "" ? optionsSetup.maxY : null,
type: "value",
scale: optionsSetup.scale,
//
@ -328,6 +330,17 @@ export default {
};
}
series[0].barWidth = optionsSetup.maxWidth;
//
series[0].showBackground = optionsSetup.isShowBackground;
series[0].backgroundStyle = {
color: optionsSetup.backgroundStyleColor,
borderColor: optionsSetup.backgroundStyleBorderColor,
borderWidth: optionsSetup.backgroundStyleBorderWidth,
borderType: optionsSetup.backgroundStyleBorderType,
shadowBlur: optionsSetup.backgroundStyleShadowBlur,
shadowColor: optionsSetup.backgroundStyleShadowColor,
opacity: optionsSetup.backgroundStyleOpacity / 100,
};
}
},
// tooltip

Loading…
Cancel
Save