l***@163.com
l***@163.com
  • 发布:2020-03-19 20:01
  • 更新:2020-03-19 20:36
  • 阅读:702

uniapp项目是否有版本的区分?为什么我在Git上面下载的折线图插件在演示的示例上面是可以显示的

分类:uni-app

uniapp项目是否有版本的区分?为什么我在Git上面下载的折线图插件在演示的示例上面是可以显示的,但是我把同样的代码新建一个项目然后在把一样的代码和插件都放到新建的项目里面之后却显示不出来了?想知道是什么原因引起的,插件在我上传的附件里面,出错的代码在下面的说明里面,还有报错日志,大佬请答疑

IDE运行环境说明
IDE:HBuilderX
版本:2.6.5
系统:windows 7
编译器版本:2.6.5
手机端调试基座版本号:2.6.5
测试机信息
苹果X 系统13.3.1

19:46:20.726 page is not ready
19:46:20.746 TypeError: undefined is not an object (evaluating 'u.$page')
19:46:20.767 IndexSizeError: The index is not in the allowed range.

//这个是以下报错的代码 <template> <view class="container"> <uni-echarts class="ec-canvas" id="chart-bar" ref="canvas-bar" canvas-id="chart-bar" ec="bar" ></uni-echarts>
</view>
</template>

<script>
import uniEcharts from '@/components/uni-echarts/uni-echarts';

export default {
components: {
uniEcharts
},
data() {
return {
bar: {
lazyload: true,
option: this.getBarOption1(),
}
};
},
methods:{
// 商业险年度保费趋势
getBarOption1() {
//return 请求数据
var option = {
//折线图标题
title: {
text: '商业险年度保费趋势',
left: 'left'
},
// 折线图线条的颜色
color: ["#3a76ff", "#e87676"],
// 折线图的线条代表意义
legend: {
itemWidth: 10,
//小圆点的宽度
right: 20,
top: 0,
bottom: 20,
orient: 'vertical',
selectedModel: 'single',
//折线可多选
inactiveColor: '#87CEEB',
data: [{
name: '发生赔款保费上浮',
icon: 'circle',
textStyle: {
color: '#d5d5d5'
}
}, {
name: '未发生赔款保费降低',
icon: 'circle',
textStyle: {
color: '#d5d5d5'
}
}],
right: 0
},
// 刻度
grid: {
top: '25%',
left: '-5%',
right: '8%',
bottom: '10%',
containLabel: true
},
xAxis: {
boundaryGap: false,
type: 'category',
axisTick: {
inside: true
},
data: [this.nowYear, this.nowYear 1, this.nowYear 2, this.nowYear 3],
splitLine: {
show: true,
lineStyle: {
// 间隔色
color: ['#e7e7e7'],
type: 'dashed'
}
},
axisLine: {
lineStyle: {
type: 'solid',
color: '#e6e6e6',
//左边线的颜色
width: '2' //坐标线的宽度

          }  
        },  
        axisLabel: {  
          textStyle: {  
            color: '#828282' //坐标值得具体的颜  
          }  
        }  
      },  
      yAxis: {  
        x: 'center',  
        type: 'value',  
        splitNumber: 9,  
        show: false  
      },  
      series: [{  
        name: '未发生赔款保费降低',  
        type: 'line',  
        animation: true,  
        itemStyle: {  
          normal: {  
            label: {  
              show: true,  
              position: 'bottom',  
              color: '#828282',  

              formatter(params) {  
                let secondNum = option.series[0].data[1].value;  

                for (var i = 0, l = option.xAxis.data.length; i < l; i  ) {  
                  if (option.xAxis.data[i] == params.name 
2020-03-19 20:01 负责人:无 分享
已邀请:
l***@163.com

l***@163.com (作者)

先顶一下吧

该问题目前已经被锁定, 无法添加新回复