From a5449caa0bb5215b402ff41068de20656e4ff584 Mon Sep 17 00:00:00 2001 From: wylyl22 <2373073266@qq.com> Date: Fri, 15 Jul 2022 13:34:49 +0800 Subject: [PATCH] wyl --- components/indexCom/insightChild/index.js | 2 +- components/option/columnarOption.js | 29 ++++++++++++++--------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/components/indexCom/insightChild/index.js b/components/indexCom/insightChild/index.js index f581b69..bd4ba8f 100644 --- a/components/indexCom/insightChild/index.js +++ b/components/indexCom/insightChild/index.js @@ -47,7 +47,7 @@ Component({ }) this.setData({ - brandOption: histogram(arr,arr1,"#0084FF") + brandOption: histogram(arr,arr1,"#20CC62") }) setTimeout(() =>{ wx.hideToast(); diff --git a/components/option/columnarOption.js b/components/option/columnarOption.js index 799bf2e..3fd4ba5 100644 --- a/components/option/columnarOption.js +++ b/components/option/columnarOption.js @@ -1,5 +1,5 @@ // 单柱状 -export default function histogram(dx=[],ds=[],data=[],color1='',direction=true) { +export default function histogram(dx=[],ds=[],color1='',direction=true) { // direction true为垂直 false为水平 return { tooltip: { @@ -9,16 +9,23 @@ export default function histogram(dx=[],ds=[],data=[],color1='',direction=true) }, confine: true }, - legend: { - x:'15', - icon: 'rectangle',//data图标样式 - itemWidth: '10',//data图标大小 - itemHeight: '10', - textStyle: { - fontSize: '9' - }, - data: data, - }, + dataZoom: [{ //添加X轴滚动条 + type: 'inside', + show: false, + start: 50, + end: 10, + handleSize: 5 + }], + // legend: { + // x:'15', + // icon: 'rectangle',//data图标样式 + // itemWidth: '10',//data图标大小 + // itemHeight: '10', + // textStyle: { + // fontSize: '9' + // }, + // data: data, + // }, //图表位置 grid: { left: 20,