feat--增加柱状图柱体间距调整

This commit is contained in:
qianming
2023-11-30 10:16:54 +08:00
parent 94fe184bc9
commit b44eb08cb2
9 changed files with 44 additions and 10 deletions

View File

@@ -33,7 +33,7 @@ export const widgetBarDoubleYaxis = {
name: 'maxWidth', name: 'maxWidth',
required: false, required: false,
placeholder: '', placeholder: '',
value: 10, value: 15,
}, },
{ {
type: 'el-slider', type: 'el-slider',
@@ -43,6 +43,14 @@ export const widgetBarDoubleYaxis = {
placeholder: '', placeholder: '',
value: 5, value: 5,
}, },
{
type: 'el-slider',
label: '间距',
name: 'barGap',
required: false,
placeholder: '',
value: 10,
},
{ {
type: 'el-slider', type: 'el-slider',
label: '最小高度', label: '最小高度',

View File

@@ -34,7 +34,7 @@ export const widgetBarStackMoreShow = {
name: 'maxWidth', name: 'maxWidth',
required: false, required: false,
placeholder: '', placeholder: '',
value: 25, value: 15,
}, },
{ {
type: 'el-slider', type: 'el-slider',
@@ -44,6 +44,14 @@ export const widgetBarStackMoreShow = {
placeholder: '', placeholder: '',
value: 5, value: 5,
}, },
{
type: 'el-slider',
label: '间距',
name: 'barGap',
required: false,
placeholder: '',
value: 10,
},
{ {
type: 'el-switch', type: 'el-switch',
label: '背景显示', label: '背景显示',

View File

@@ -61,7 +61,7 @@ export const widgetBarStack = {
name: 'maxWidth', name: 'maxWidth',
required: false, required: false,
placeholder: '', placeholder: '',
value: 20, value: 15,
}, },
{ {
type: 'el-slider', type: 'el-slider',
@@ -77,7 +77,7 @@ export const widgetBarStack = {
name: 'barGap', name: 'barGap',
required: false, required: false,
placeholder: '', placeholder: '',
value: 0, value: 10,
}, },
{ {
type: 'el-switch', type: 'el-switch',

View File

@@ -49,7 +49,7 @@ export const widgetBarchart = {
name: 'maxWidth', name: 'maxWidth',
required: false, required: false,
placeholder: '', placeholder: '',
value: 10, value: 15,
}, },
{ {
type: 'el-slider', type: 'el-slider',
@@ -59,6 +59,14 @@ export const widgetBarchart = {
placeholder: '', placeholder: '',
value: 5, value: 5,
}, },
{
type: 'el-slider',
label: '间距',
name: 'barGap',
required: false,
placeholder: '',
value: 10,
},
{ {
type: 'el-slider', type: 'el-slider',
label: '最小高度', label: '最小高度',

View File

@@ -49,7 +49,7 @@ export const widgetGradientBarchart = {
name: 'maxWidth', name: 'maxWidth',
required: false, required: false,
placeholder: '', placeholder: '',
value: 10, value: 15,
}, },
{ {
type: 'el-slider', type: 'el-slider',
@@ -59,6 +59,14 @@ export const widgetGradientBarchart = {
placeholder: '', placeholder: '',
value: 5, value: 5,
}, },
{
type: 'el-slider',
label: '间距',
name: 'barGap',
required: false,
placeholder: '',
value: 10,
},
{ {
type: 'el-switch', type: 'el-switch',
label: '背景显示', label: '背景显示',

View File

@@ -312,6 +312,7 @@ export default {
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].barGap = optionsSetup.barGap + "%";
series[key].label = { series[key].label = {
show: optionsSetup.isShow, show: optionsSetup.isShow,
position: optionsSetup.fontPosition, position: optionsSetup.fontPosition,

View File

@@ -348,7 +348,7 @@ export default {
name: item.name, name: item.name,
type: "bar", type: "bar",
data: item.list.map((item) => item.data), data: item.list.map((item) => item.data),
barGap: "0%", barGap: optionsSetup.barGap + "%",
barWidth: optionsSetup.maxWidth, barWidth: optionsSetup.maxWidth,
label: { label: {
show: optionsSetup.isShow, show: optionsSetup.isShow,
@@ -449,7 +449,7 @@ export default {
name: item.name, name: item.name,
type: "bar", type: "bar",
data: item.list.map((item) => item.data), data: item.list.map((item) => item.data),
barGap: "0%", barGap: optionsSetup.barGap + "%",
barWidth: optionsSetup.maxWidth, barWidth: optionsSetup.maxWidth,
label: { label: {
show: optionsSetup.isShow, show: optionsSetup.isShow,

View File

@@ -348,7 +348,7 @@ export default {
for (const i in series) { for (const i in series) {
if (series[i].type == "bar") { if (series[i].type == "bar") {
series[i].type = "bar"; series[i].type = "bar";
series[i].barGap = "0%"; series[i].barGap = optionsSetup.barGap + "%";
series[i].barWidth = optionsSetup.maxWidth; series[i].barWidth = optionsSetup.maxWidth;
series[i].barMinHeight = optionsSetup.minHeight; series[i].barMinHeight = optionsSetup.minHeight;
series[i].label = { series[i].label = {
@@ -468,7 +468,7 @@ export default {
const obj = {}; const obj = {};
if (val.series[i].type == "bar") { if (val.series[i].type == "bar") {
obj.type = "bar"; obj.type = "bar";
obj.barGap = "0%"; obj.barGap = optionsSetup.barGap + "%";
obj.stack = this.getStackStyle(); obj.stack = this.getStackStyle();
obj.barWidth = optionsSetup.maxWidth; obj.barWidth = optionsSetup.maxWidth;
obj.barMinHeight = optionsSetup.minHeight; obj.barMinHeight = optionsSetup.minHeight;

View File

@@ -306,6 +306,7 @@ export default {
const optionsSetup = this.optionsSetup; const optionsSetup = this.optionsSetup;
const series = this.options.series; const series = this.options.series;
if (series[0].type == "bar") { if (series[0].type == "bar") {
series[0].barGap = optionsSetup.barGap + "%";
series[0].label = { series[0].label = {
show: optionsSetup.isShow, show: optionsSetup.isShow,
position: optionsSetup.fontPosition, position: optionsSetup.fontPosition,