切换时,清空画布
This commit is contained in:
+35
-49
@@ -66,6 +66,7 @@ Page({
|
||||
is_biz: 0, //是否选择门店跳转过来
|
||||
scoreData: [],
|
||||
showLineChart: false, //是否显示Line图表
|
||||
unloadingLineChart: false,// 是否加载图标
|
||||
ecLine: {
|
||||
onInit: lineChart
|
||||
},
|
||||
@@ -172,60 +173,45 @@ Page({
|
||||
},
|
||||
|
||||
getChartsData() {
|
||||
lineChartData = {
|
||||
backgroundColor: "#ffffff",
|
||||
xAxis: {
|
||||
show: false
|
||||
},
|
||||
yAxis: {
|
||||
show: false
|
||||
},
|
||||
radar: {
|
||||
// shape: 'circle',
|
||||
splitArea: {
|
||||
areaStyle: {
|
||||
color: ['#f6f6f6', '#ffffff']
|
||||
}
|
||||
},
|
||||
indicator: [{
|
||||
name: '拓客能力',
|
||||
max: 100
|
||||
},
|
||||
{
|
||||
name: '跟进能力',
|
||||
max: 100
|
||||
},
|
||||
{
|
||||
name: '邀约能力',
|
||||
max: 100
|
||||
},
|
||||
{
|
||||
name: '成交能力',
|
||||
max: 100
|
||||
},
|
||||
{
|
||||
name: '交付能力',
|
||||
max: 100
|
||||
}
|
||||
]
|
||||
},
|
||||
series: [{
|
||||
name: '标题',
|
||||
type: 'radar',
|
||||
data: [{
|
||||
value: [0, 0, 0, 0, 0],
|
||||
name: '预算',
|
||||
...this.data.chartOrangeStyle //...this.data.chartGreenStyle
|
||||
}]
|
||||
}]
|
||||
};
|
||||
|
||||
let params = {}
|
||||
params['day_type'] = this.data.tab_date_cur
|
||||
this.setData({
|
||||
unloadingLineChart: false
|
||||
})
|
||||
_.apiQuery.appRadar(params).then(res => {
|
||||
lineChartData.radar.indicator = res.data.indicator
|
||||
lineChartData.series[0].data[0].value = res.data.series_value
|
||||
lineChartData = {
|
||||
backgroundColor: "#ffffff",
|
||||
xAxis: {
|
||||
show: false
|
||||
},
|
||||
yAxis: {
|
||||
show: false
|
||||
},
|
||||
radar: {
|
||||
// shape: 'circle',
|
||||
splitArea: {
|
||||
areaStyle: {
|
||||
color: ['#f6f6f6', '#ffffff']
|
||||
}
|
||||
},
|
||||
indicator: res.data.indicator
|
||||
},
|
||||
series: [{
|
||||
name: '标题',
|
||||
type: 'radar',
|
||||
data: [{
|
||||
value: res.data.series_value,
|
||||
name: '预算',
|
||||
...this.data.chartOrangeStyle //...this.data.chartGreenStyle
|
||||
}]
|
||||
}]
|
||||
};
|
||||
// lineChartData.radar.indicator = res.data.indicator
|
||||
// lineChartData.series[0].data[0].value = res.data.series_value
|
||||
this.setData({
|
||||
showLineChart: true,
|
||||
unloadingLineChart: true,
|
||||
['ecLine.onInit']: lineChart,
|
||||
})
|
||||
})
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
</block>
|
||||
|
||||
<view class="echarts-con" style="width:100%;height:500rpx;" wx:if="{{showLineChart}}">
|
||||
<ec-canvas id="mychart-dom-line" ec="{{ ecLine }}"></ec-canvas>
|
||||
<ec-canvas wx:if="{{unloadingLineChart}}" id="mychart-dom-line" ec="{{ ecLine }}"></ec-canvas>
|
||||
</view>
|
||||
|
||||
<view class="text-center pt40">
|
||||
|
||||
Reference in New Issue
Block a user