Commit 3b804148 by sunchao

图表不显示bug修复

parent 097b1b1f
......@@ -16,7 +16,7 @@
"type" : "uniCloud"
},
{
"playground" : "standard",
"playground" : "custom",
"type" : "uni-app:app-ios"
}
]
......
......@@ -70,7 +70,7 @@
.personalInfo {
background: #fff;
width: 95%;
margin: 6rpx auto 0;
margin: 20rpx auto 0;
.ulBox {
padding: 0 30rpx;
......
......@@ -103,7 +103,8 @@
<view class="title"><view>测算结果及建议</view></view>
<!-- 图表 -->
<!-- 为 ECharts 准备一个定义了宽高的 DOM -->
<view id="main" style="width:96vw;height:400px" v-if="resultInfo"></view>
<!-- <view id="main" style="width:96vw;height:400px" v-if="resultInfo"></view> -->
<l-echart ref="chart" @finished="init" v-if="resultInfo"></l-echart>
<view class="summaryContent" v-if="resultInfo">
<view class="successInfo" v-if="resultInfo.code=='B001'">
<strong>恭喜您!</strong>
......@@ -165,7 +166,8 @@
import api from "../../api/api";
import common from "../../common/common";
import dataHandling from "../../util/dataHandling";
import { nanoid } from "nanoid";
import { nanoid } from "nanoid";
import LEchart from '@/uni_modules/lime-echart/components/l-echart/l-echart.vue';
export default {
data() {
......@@ -196,9 +198,15 @@ import { nanoid } from "nanoid";
dataTree: [],
schoolingLists:eduGradeLists,
flatEduGradeLists:[],
option:{}
}
},
methods: {
init() {
this.$refs.chart.init(echarts, chart => {
chart.setOption(this.option);
});
},
getEducationNo(val){
if(val){
return this.flatEduGradeLists.filter(item=>item.value==val)[0].educationNo;
......@@ -258,9 +266,9 @@ import { nanoid } from "nanoid";
},
drawLine(){
// 基于准备好的dom,初始化echarts实例
var myChart = echarts.init(document.getElementById('main'));
// var myChart = echarts.init(document.getElementById('main'));
// 指定图表的配置项和数据
var option = {
this.option = {
title: {},
tooltip: {
trigger: 'axis',
......@@ -338,7 +346,10 @@ import { nanoid } from "nanoid";
};
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(option);
// myChart.setOption(option);
this.$refs.chart.init(echarts, chart => {
chart.setOption(this.option);
});
},
settingYBY(item){
// 逐年设定
......@@ -504,7 +515,8 @@ import { nanoid } from "nanoid";
},
components:{
commonHead,
foot
foot,
LEchart
}
}
</script>
......
......@@ -142,8 +142,8 @@
</view>
</form>
<!--测算结果-- v-show="resultFlag"-->
<!-- <view class="result_wrapper" v-if="resultFlag"> -->
<view class="result_wrapper">
<view class="result_wrapper" v-if="resultFlag">
<!-- <view class="result_wrapper"> -->
<view class="suggestInfo">
<view class="title">
<view>
......@@ -160,10 +160,10 @@
</label>
</radio-group>
</view>
<view style="height: 450rpx;width: 500rpx;border: 1rpx solid #c3c1c1;">
<!-- <view style="height: 450rpx;width: 500rpx;border: 1rpx solid #c3c1c1;"> -->
<!-- <view id="myEcharts"></view> -->
<l-echart ref="chart" @finished="init"></l-echart>
</view>
<!-- </view> -->
<!-- <view class="linechart">
<Echarts ref="echart" :option="option" style="height: 300px;"></Echarts>
</view> -->
......@@ -842,7 +842,7 @@
padding: 10rpx 0;
margin-left: -10rpx;
image{
position: absolute;
position: absolute!important;
right: 0;
max-width: 17%;
top: 3%;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment