柱线图调整,去掉图例

qianming 3 years ago
parent 95ac1cf6c2
commit fe08b9392c

@ -129,7 +129,7 @@ export default {
return data return data
} }
}, },
// 柱状图、折线图、柱图 // 柱状图、折线图、线
barOrLineChartFn(chartProperties, data) { barOrLineChartFn(chartProperties, data) {
const ananysicData = {}; const ananysicData = {};
const xAxisList = []; const xAxisList = [];

@ -1,5 +1,5 @@
/* /*
* @Descripttion: 线图 * @Descripttion: 线图
* @version: * @version:
* @Author: qianlishi * @Author: qianlishi
* @Date: 2021-08-29 07:26:48 * @Date: 2021-08-29 07:26:48
@ -595,7 +595,7 @@ export const widgetBarlinechart = {
list: [ list: [
{ {
type: 'el-switch', type: 'el-switch',
label: '图例', label: '显示',
name: 'isShowLegend', name: 'isShowLegend',
required: false, required: false,
placeholder: '', placeholder: '',
@ -610,7 +610,7 @@ export const widgetBarlinechart = {
value: '#fff', value: '#fff',
}, },
{ {
type: 'el-input-text', type: 'el-input-number',
label: '字体大小', label: '字体大小',
name: 'lengedFontSize', name: 'lengedFontSize',
required: false, required: false,
@ -632,10 +632,11 @@ export const widgetBarlinechart = {
required: false, required: false,
placeholder: '', placeholder: '',
selectOptions: [ selectOptions: [
{code: 'center', name: '居中'},
{code: 'left', name: '左对齐'}, {code: 'left', name: '左对齐'},
{code: 'right', name: '右对齐'}, {code: 'right', name: '右对齐'},
], ],
value: '' value: 'center'
}, },
{ {
type: 'el-select', type: 'el-select',
@ -647,7 +648,7 @@ export const widgetBarlinechart = {
{code: 'top', name: '顶部'}, {code: 'top', name: '顶部'},
{code: 'bottom', name: '底部'}, {code: 'bottom', name: '底部'},
], ],
value: '' value: 'top'
}, },
{ {
type: 'el-select', type: 'el-select',
@ -659,7 +660,7 @@ export const widgetBarlinechart = {
{code: 'vertical', name: '竖排'}, {code: 'vertical', name: '竖排'},
{code: 'horizontal', name: '横排'}, {code: 'horizontal', name: '横排'},
], ],
value: '' value: 'horizontal'
}, },
], ],
}, },

@ -31,7 +31,6 @@ export default {
textStyle: { textStyle: {
color: "#fff" color: "#fff"
}, },
data: ["货运量", "货运总量"]
}, },
xAxis: [ xAxis: [
{ {
@ -139,7 +138,7 @@ export default {
this.setOptionsTooltip(); this.setOptionsTooltip();
this.setOptionsData(); this.setOptionsData();
this.setOptionsMargin(); this.setOptionsMargin();
this.setOptionsLegend(); //this.setOptionsLegend();
this.setOptionsColor(); this.setOptionsColor();
}, },
// //
@ -341,23 +340,23 @@ export default {
}; };
this.options.grid = grid; this.options.grid = grid;
}, },
// legend /* // 图例操作 legend
setOptionsLegend() { setOptionsLegend() {
const optionsCollapse = this.optionsSetup; const optionsCollapse = this.optionsSetup;
const legend = this.options.legend; const legend = this.options.legend;
legend.show = optionsCollapse.isShowLegend; legend.show = optionsCollapse.isShowLegend;
legend.left = optionsCollapse.lateralPosition == "left" ? 0 : "auto"; legend.left = optionsCollapse.lateralPosition;
legend.right = optionsCollapse.lateralPosition == "right" ? 0 : "auto";
legend.top = optionsCollapse.longitudinalPosition == "top" ? 0 : "auto"; legend.top = optionsCollapse.longitudinalPosition == "top" ? 0 : "auto";
legend.bottom = legend.bottom =
optionsCollapse.longitudinalPosition == "bottom" ? 0 : "auto"; optionsCollapse.longitudinalPosition == "bottom" ? 0 : "auto";
legend.orient = optionsCollapse.layoutFront; legend.orient = optionsCollapse.layoutFront;
legend.textStyle = { legend.textStyle = {
color: optionsCollapse.lengedColor, color: optionsCollapse.lengedColor,
fontSize: optionsCollapse.fontSize fontSize: optionsCollapse.lengedFontSize
}; };
legend.itemWidth = optionsCollapse.lengedWidth; legend.itemWidth = optionsCollapse.lengedWidth;
}, console.log(legend);
},*/
// //
setOptionsColor() { setOptionsColor() {
const optionsCollapse = this.optionsSetup; const optionsCollapse = this.optionsSetup;
@ -373,7 +372,6 @@ export default {
// //
setOptionsData() { setOptionsData() {
const optionsData = this.optionsData; // or const optionsData = this.optionsData; // or
console.log(optionsData);
optionsData.dataType == "staticData" optionsData.dataType == "staticData"
? this.staticDataFn(optionsData.staticData) ? this.staticDataFn(optionsData.staticData)
: this.dynamicDataFn(optionsData.dynamicData, optionsData.refreshTime); : this.dynamicDataFn(optionsData.dynamicData, optionsData.refreshTime);

Loading…
Cancel
Save