diff --git a/components/option/multiColumnsOption.js b/components/option/multiColumnsOption.js index 56bbcde..90b8d15 100644 --- a/components/option/multiColumnsOption.js +++ b/components/option/multiColumnsOption.js @@ -30,7 +30,16 @@ export default function multiColumnsOption(dx=[], dValue=[], dName=[]) { type: 'line' // 'shadow' as default; can also be 'line' or 'shadow' }, }, - legend: {}, + legend: { + icon: 'rectangle', //data图标样式 + itemWidth: 8, //data图标大小 + itemHeight: 8, + left: 5, + textStyle: { + fontSize: 10, + fontWeight: 400 + }, + }, grid: { bottom: 20 }, diff --git a/components/option/negaposiOption.js b/components/option/negaposiOption.js index 9814fe2..f059be6 100644 --- a/components/option/negaposiOption.js +++ b/components/option/negaposiOption.js @@ -10,6 +10,34 @@ export default function negaposiOption(dName=[], dPositive=[], dNegative = []) { console.log( dPositive ); + const dns = []; // 负面 + const dps = []; // 正面 + for(let i = 0; i <= dNegative.length - 1; i++) { + if(dNegative[i] == 0 && dPositive[i] != 0) { + dps[i] = { + value: dPositive[i], + itemStyle:{ + normal:{ + barBorderRadius:[12,12,12,12], + color: '#0084FF', + } + }, + } + } else if(dNegative[i] != 0 && dPositive[i] == 0) { + dns[i] = { + value: dNegative[i], + itemStyle: { + normal:{ + barBorderRadius:[12,12,12,12], + color: '#FFBF00', + } + } + } + } else { + dns[i] = dNegative[i]; + dps[i] = dPositive[i]; + } + } return { tooltip: { trigger: 'axis', @@ -76,7 +104,7 @@ export default function negaposiOption(dName=[], dPositive=[], dNegative = []) { emphasis: { focus: 'series' }, - data: dPositive + data: dps }, { name: '负面调性', @@ -99,7 +127,7 @@ export default function negaposiOption(dName=[], dPositive=[], dNegative = []) { emphasis: { focus: 'series' }, - data: dNegative + data: dns } ] }; diff --git a/components/option/percentRankOption.js b/components/option/percentRankOption.js index c5bd498..751f12c 100644 --- a/components/option/percentRankOption.js +++ b/components/option/percentRankOption.js @@ -57,7 +57,7 @@ export default function pictographicOption(dRegion=[],dValue=[]){ // offset: [20, 0], color: '#333333', fontSize: 12, - position:[60,-4] + position:[60,-2] }, showBackground: true, backgroundStyle: { diff --git a/components/option/pictographicOption.js b/components/option/pictographicOption.js index 485d7e6..3a2bdbc 100644 --- a/components/option/pictographicOption.js +++ b/components/option/pictographicOption.js @@ -59,7 +59,7 @@ export default function pictographicOption(dRegion = [], dValue = [], dSum = 0) // offset: [20, 0], color: '#333333', fontSize: 12, - position: [50, -5] + position: [60, -2] }, showBackground: true, backgroundStyle: { diff --git a/components/option/pictographicOption2.js b/components/option/pictographicOption2.js index 42a9ad0..7fb8cb4 100644 --- a/components/option/pictographicOption2.js +++ b/components/option/pictographicOption2.js @@ -57,7 +57,7 @@ export default function pictographicOption(dRegion = [], dValue = [], dSum = 0) return ((params.value / dSum) * 100).toFixed(2) + ' %'; }, // position: 'right', - position:[180,0], + position:[200,1], // offset: [20, 0], color: '#333333', fontSize: 12, diff --git a/pages/insight/pages/brandInsight/weiboInsight/index.js b/pages/insight/pages/brandInsight/weiboInsight/index.js index d22bf64..79ecafa 100644 --- a/pages/insight/pages/brandInsight/weiboInsight/index.js +++ b/pages/insight/pages/brandInsight/weiboInsight/index.js @@ -270,7 +270,9 @@ Component({ dPositive.push((ele.value[0].value * 100 / total).toFixed(0)); dNegative.push((ele.value[2].value * 100 / total).toFixed(0)); } + console.log('0000',dName) }); + this.setData({affNegaposi: negaposiOption(dName,dPositive,dNegative)}) }); this.getWordCloud(); diff --git a/project.private.config.json b/project.private.config.json index 1c0c085..d19e106 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -21,13 +21,6 @@ "query": "", "launchMode": "default", "scene": null - }, - { - "name": "", - "pathName": "pages/index/Salesranking/Salesranking", - "query": "", - "launchMode": "default", - "scene": null } ] }