From 32d3c922e4b30290d23fe1798d1363c0e6961a43 Mon Sep 17 00:00:00 2001 From: xuyiming Date: Wed, 26 Aug 2020 14:11:03 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E7=BB=87=E8=BF=90=E8=A1=8C=E6=A6=82?= =?UTF-8?q?=E5=86=B5=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/e-charts/bar-chart.vue | 99 ++++--- src/components/e-charts/commentlist.vue | 48 +++- src/components/e-charts/the-list.vue | 17 +- src/components/e-charts/toplist.vue | 66 +++-- .../data-analysis/operation-overview.vue | 260 +++++++----------- 5 files changed, 245 insertions(+), 245 deletions(-) diff --git a/src/components/e-charts/bar-chart.vue b/src/components/e-charts/bar-chart.vue index 2400096..20e77de 100644 --- a/src/components/e-charts/bar-chart.vue +++ b/src/components/e-charts/bar-chart.vue @@ -11,40 +11,45 @@ export default { default: () => { return { legendData: [], - seriesData: [] + seriesData: [], }; - } + }, }, bar_width: { type: Number, - default: 12 + default: 12, }, colors: { type: Array, default: () => { return ["#274fee", "#274fee"]; - } + }, }, bar_border_radius: { type: Array, default: () => { return [10, 10, 10, 10]; - } + }, }, show_split: { type: Boolean, - default: false + default: false, }, x_router: { type: Number, - default: 0 - } + default: 0, + }, + xAxis_text_length: { + type: Number, + default: 0, + }, }, data: () => ({}), mounted() {}, methods: { bar() { let self = this; + return { tooltip: { trigger: "axis", @@ -55,14 +60,14 @@ export default { htmlStr += params[i].value; } return htmlStr; - } + }, }, grid: { left: 10, right: 10, bottom: 25, top: 25, - containLabel: true + containLabel: true, }, xAxis: [ { @@ -72,65 +77,71 @@ export default { margin: 20, color: "#0d1847", textStyle: { - fontSize: 12 + fontSize: 12, }, interval: 0, rotate: self.x_router, - /* formatter: function(value) { - let valueTxt = ""; - if (value.length > 6) { - valueTxt = value.substring(0, 5) + "..."; + formatter: function(value) { + let maxLen = self.xAxis_text_length; + + if (maxLen > 1) { + let valueTxt = ""; + if (value.length > maxLen) { + valueTxt = value.substring(0, maxLen - 1) + "..."; + } else { + valueTxt = value; + } + return valueTxt; } else { - valueTxt = value; + return value; } - return valueTxt; - } */ + }, }, axisLine: { lineStyle: { - color: "#f2f2f2" - } + color: "#f2f2f2", + }, }, axisTick: { - show: false + show: false, }, splitArea: { show: true, areaStyle: { color: ["#fff", "#f8f9fd"], - opacity: 0.5 + opacity: 0.5, }, - interval: 0 + interval: 0, }, axisPointer: { type: "shadow", }, - } + }, ], yAxis: [ { axisLabel: { color: "#a9aec0", textStyle: { - fontSize: 12 - } + fontSize: 12, + }, }, minInterval: 1, axisLine: { lineStyle: { - color: "rgba(0, 0, 0, 0)" - } + color: "rgba(0, 0, 0, 0)", + }, }, axisTick: { - show: false + show: false, }, splitLine: { lineStyle: { color: "#f2f2f2", - type: "solid" - } - } - } + type: "solid", + }, + }, + }, ], series: [ { @@ -148,24 +159,24 @@ export default { [ { offset: 0, - color: self.colors[0] // 0% 处的颜色 + color: self.colors[0], // 0% 处的颜色 }, { offset: 1, - color: self.colors[1] // 100% 处的颜色 - } + color: self.colors[1], // 100% 处的颜色 + }, ], false ); }, - barBorderRadius: self.bar_border_radius - } - } - } - ] + barBorderRadius: self.bar_border_radius, + }, + }, + }, + ], }; - } - } + }, + }, }; \ No newline at end of file + diff --git a/src/components/e-charts/commentlist.vue b/src/components/e-charts/commentlist.vue index 47cff06..cadc72f 100644 --- a/src/components/e-charts/commentlist.vue +++ b/src/components/e-charts/commentlist.vue @@ -1,13 +1,27 @@