From df0137a69c0ddae5f96419cd8aec6cbc106195b7 Mon Sep 17 00:00:00 2001 From: xiaowen <372193233@qq.com> Date: Fri, 19 Aug 2022 13:49:24 +0800 Subject: [PATCH] cxw-010203 --- components/word-cloud/index.js | 11 +++++++++-- components/word-cloud/index.wxss | 2 ++ contrastPackages/brandRatio/survey/index.wxml | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/components/word-cloud/index.js b/components/word-cloud/index.js index c1e8c41..3035cc3 100644 --- a/components/word-cloud/index.js +++ b/components/word-cloud/index.js @@ -21,6 +21,10 @@ Component({ type: Array, value: [], }, + lvl: { + type: [Number, String], + value: 18 + }, color: { type: String, value: 'random-dark' @@ -37,7 +41,10 @@ Component({ query.select('#' + this.data.canvasId) .fields({ node: true, size: true }) .exec((res) => { - this.data.canvas = res[0].node + this.setData({ + canvas: res[0].node + }) + // this.data.canvas = res[0].node }) }, }, @@ -113,7 +120,7 @@ Component({ return [] } let arr = []; - let max = 18; + let max = this.data.lvl; let maxVal = list[0][1]; list.forEach(ele => { let a = [ele[0], ele[1] / maxVal * max]; diff --git a/components/word-cloud/index.wxss b/components/word-cloud/index.wxss index 26329ab..1a0c7fe 100644 --- a/components/word-cloud/index.wxss +++ b/components/word-cloud/index.wxss @@ -12,6 +12,8 @@ } .wc-main { position: relative; + width: 100%; + height: 100%; margin-left: -40%; margin-top: -46px; } diff --git a/contrastPackages/brandRatio/survey/index.wxml b/contrastPackages/brandRatio/survey/index.wxml index ef90c91..f497b20 100644 --- a/contrastPackages/brandRatio/survey/index.wxml +++ b/contrastPackages/brandRatio/survey/index.wxml @@ -119,7 +119,7 @@ {{item.name}} - +