diff --git a/src/components/charts/bar/index.js b/src/components/charts/bar/index.js index 300e27c..6a83bc1 100644 --- a/src/components/charts/bar/index.js +++ b/src/components/charts/bar/index.js @@ -25,6 +25,14 @@ export default { type: String, default: '单位:万元' }, + interval: { + type: Number, + default: null + }, + rotate: { + type: Number, + default: 0 + }, serverName: { type: String, default: '面积' @@ -76,7 +84,20 @@ export default { const erd = elementResizeDetectorMaker(); erd.listenTo(document.getElementById(this.id), () => { this.$nextTick(() => { + if (document.getElementById(this.id).offsetWidth > 500){ + this.rotate = 60; + }else{ + this.rotate = 0; + } this.chart.resize(); + this.chart.setOption({ + // 新的配置项,例如: + xAxis: { + axisLabel: { + rotate: this.rotate + }, + } + }); }); }); }, @@ -145,6 +166,7 @@ export default { }, axisLabel: { show: true, + rotate: this.rotate, color: 'rgba(185, 211, 235, 1)' }, }, @@ -254,7 +276,6 @@ export default { }; this.chart.setOption(option); this.initResizeCallBack(); - } } }; diff --git a/src/components/pannelNew/index.scss b/src/components/pannelNew/index.scss index 9da57ed..86e1a02 100644 --- a/src/components/pannelNew/index.scss +++ b/src/components/pannelNew/index.scss @@ -84,7 +84,7 @@ width: 100%; position: relative; flex: 1; - background-color: rgba(1,20,44,.6); + background-color: rgba(1,20,44,.9); overflow: hidden; .bottom_line { diff --git a/src/views/sanqing/main-gis/index.html b/src/views/sanqing/main-gis/index.html index 28f6ff2..b901720 100644 --- a/src/views/sanqing/main-gis/index.html +++ b/src/views/sanqing/main-gis/index.html @@ -93,7 +93,7 @@