堆叠图样式更新

qianming 3 years ago
parent cce203363b
commit dfb033ac6f

@ -5707,19 +5707,11 @@ const widgetTools = [
name: 'maxWidth', name: 'maxWidth',
required: false, required: false,
placeholder: '', placeholder: '',
value: 10, value: 20,
},
{
type: 'el-slider',
label: '圆角',
name: 'radius',
require: false,
placeholder: '',
value: 5,
}, },
], ],
}, },
{ /* {
name: '标题设置', name: '标题设置',
list: [ list: [
{ {
@ -6050,15 +6042,16 @@ const widgetTools = [
}, },
], ],
}, },
{ /!*{
name: '提示语设置', name: '提示语设置',
list: [ list: [
{ {
type: 'el-input-number', type: 'el-input-number',
label: '字体大小', label: '字体大小',
name: 'fontSize', name: 'tipsFontSize',
required: false, required: false,
placeholder: '', placeholder: '',
value: 16
}, },
{ {
type: 'vue-color', type: 'vue-color',
@ -6068,7 +6061,7 @@ const widgetTools = [
placeholder: '', placeholder: '',
}, },
], ],
}, },*!/
{ {
name: '坐标轴边距设置', name: '坐标轴边距设置',
list: [ list: [
@ -6145,11 +6138,11 @@ const widgetTools = [
required: false, required: false,
placeholder: '', placeholder: '',
selectOptions: [ selectOptions: [
{code: 'center', name: '居中'},
{code: 'left', name: '左对齐'}, {code: 'left', name: '左对齐'},
{code: 'right', name: '右对齐'}, {code: 'right', name: '右对齐'},
//{code: 'mid', name: '居中'},
], ],
value: 'left' value: 'center'
}, },
{ {
type: 'el-select', type: 'el-select',
@ -6176,7 +6169,7 @@ const widgetTools = [
value: 'horizontal' value: 'horizontal'
}, },
], ],
}, },*/
/*{ /*{
name: '自定义配色', name: '自定义配色',
list: [ list: [

@ -93,13 +93,14 @@ export default {
methods: { methods: {
// options // options
editorOptions() { editorOptions() {
this.setOptionsTitle(); //this.setOptionBar();
this.setOptionsX(); //this.setOptionsTitle();
this.setOptionsY(); //this.setOptionsX();
this.setOptionsTop(); //this.setOptionsY();
this.setOptionsTooltip(); //this.setOptionsTop();
this.setOptionsMargin(); //this.setOptionsTooltip();
this.setOptionsLegend(); //this.setOptionsMargin();
//this.setOptionsLegend();
//this.setOptionsColor(); //this.setOptionsColor();
this.setOptionsData(); this.setOptionsData();
}, },
@ -195,11 +196,25 @@ export default {
}; };
this.options.yAxis = yAxis; this.options.yAxis = yAxis;
}, },
// or //
setOptionBar() {
const optionsSetup = this.optionsSetup;
const series = this.options.series;
const itemStyle = {
borderRadius: optionsSetup.radius
}
const barWidth = optionsSetup.maxWidth;
for (const key in series) {
if (series[key].type == "bar") {
this.options.series[key].itemStyle = itemStyle
}
}
;
},
// or
setOptionsTop() { setOptionsTop() {
const optionsCollapse = this.optionsSetup; const optionsCollapse = this.optionsSetup;
const series = this.options.series; const series = this.options.series;
for (const key in series) { for (const key in series) {
if (series[key].type == "bar") { if (series[key].type == "bar") {
series[key].label = { series[key].label = {
@ -211,25 +226,23 @@ export default {
fontWeight: optionsCollapse.fontWeight fontWeight: optionsCollapse.fontWeight
}; };
series[key].barWidth = optionsCollapse.maxWidth; series[key].barWidth = optionsCollapse.maxWidth;
console.log(series[key].barWidth)
series[key].barMinHeight = optionsCollapse.minHeight;
} }
} }
this.options.series = series; this.options.series = series;
}, },
// tooltip // tooltip
setOptionsTooltip() { /* setOptionsTooltip() {
const optionsCollapse = this.optionsSetup; const optionsCollapse = this.optionsSetup;
const tooltip = { const tooltip = {
trigger: "item", trigger: "item",
show: true, show: true,
textStyle: { textStyle: {
color: optionsCollapse.lineColor, color: optionsCollapse.lineColor,
fontSize: optionsCollapse.fontSize fontSize: optionsCollapse.tipsFontSize
} }
}; };
this.options.tooltip = tooltip; this.options.tooltip = tooltip;
}, },*/
// //
setOptionsMargin() { setOptionsMargin() {
const optionsCollapse = this.optionsSetup; const optionsCollapse = this.optionsSetup;
@ -329,11 +342,12 @@ export default {
series.push({ series.push({
name: yAxisList[i], name: yAxisList[i],
type: "bar", type: "bar",
data: data , data: data,
barGap: "0%", barGap: "0%",
/*itemStyle: { barWidth : optionsSetup.maxWidth,
itemStyle: {
borderRadius: null borderRadius: null
}*/ }
}) })
} }
this.options.series = series this.options.series = series

Loading…
Cancel
Save