切换时,清空画布

This commit is contained in:
xiaolian
2024-11-04 17:58:11 +08:00
parent 5edc75317d
commit 4bd8d4a603
2 changed files with 36 additions and 50 deletions
+35 -49
View File
@@ -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,
})
})
+1 -1
View File
@@ -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">