feat--柱状图数据设定增加是否显示百分比符号

qianming 1 year ago
parent 814e363043
commit 234ff615ba

@ -536,6 +536,14 @@ export const widgetBarStack = {
placeholder: '',
value: false
},
{
type: 'el-switch',
label: '百分比符号显示',
name: 'percentSign',
required: false,
placeholder: '',
value: false
},
{
type: 'el-input-number',
label: '字体字号',
@ -550,7 +558,7 @@ export const widgetBarStack = {
name: 'dataColor',
required: false,
placeholder: '',
value: '#fff'
value: ''
},
{
type: 'el-select',

@ -574,7 +574,7 @@ export const widgetBarchart = {
name: 'dataColor',
required: false,
placeholder: '',
value: '#fff'
value: ''
},
{
type: 'el-select',

@ -426,6 +426,14 @@ export const widgetGradientBarchart = {
placeholder: '',
value: true
},
{
type: 'el-switch',
label: '百分比符号显示',
name: 'percentSign',
required: false,
placeholder: '',
value: false
},
{
type: 'el-input-number',
label: '距离',
@ -538,7 +546,7 @@ export const widgetGradientBarchart = {
name: 'bar100color',
required: false,
placeholder: '',
value: 'rgba(0,77,167,1)'
value: 'rgba(255, 69, 0, 1)'
},
{
type: 'vue-color',

@ -369,6 +369,7 @@ export default {
fontSize: optionsSetup.fontSize,
color: optionsSetup.dataColor,
fontWeight: optionsSetup.fontWeight,
formatter: !!optionsSetup.percentSign ? '{c}%' : '{c}'
},
//
itemStyle: {
@ -450,6 +451,7 @@ export default {
fontSize: optionsSetup.fontSize,
color: optionsSetup.dataColor,
fontWeight: optionsSetup.fontWeight,
formatter: !!optionsSetup.percentSign ? '{c}%' : '{c}'
},
//
itemStyle: {

@ -392,10 +392,10 @@ export default {
};
}
series[i].data = data;
this.options.legend["data"] = legendName;
this.setOptionsLegendName(legendName);
}
}
this.options.legend["data"] = legendName;
this.setOptionsLegendName(legendName);
},
//
dynamicDataFn(refreshTime) {

@ -314,6 +314,7 @@ export default {
fontSize: optionsSetup.fontSize,
color: optionsSetup.dataColor,
fontWeight: optionsSetup.fontWeight,
formatter: !!optionsSetup.percentSign ? '{c}%' : '{c}'
};
} else {
series[0].label = {
@ -323,6 +324,7 @@ export default {
fontSize: optionsSetup.fontSize,
color: optionsSetup.dataColor,
fontWeight: optionsSetup.fontWeight,
formatter: !!optionsSetup.percentSign ? '{c}%' : '{c}'
};
}
series[0].barWidth = optionsSetup.maxWidth;
@ -360,7 +362,7 @@ export default {
let normal = {};
if (optionsSetup.verticalShow) {
normal = {
color: new echarts.graphic.LinearGradient(1, 0, 0, 0, [
color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [
{
offset: 0,
color: optionsSetup.bar0color, // 0%
@ -376,7 +378,7 @@ export default {
};
} else {
normal = {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
{
offset: 0,
color: optionsSetup.bar0color, // 0%
@ -395,7 +397,6 @@ export default {
},
//
setOptionsData(e, paramsConfig) {
const optionsSetup = this.optionsSetup;
const optionsData = this.optionsData; // or
//
optionsData.dynamicData = optionsData.dynamicData || {}; // dynamicData undefined

Loading…
Cancel
Save