美文网首页
鸿蒙第18课手表心率曲线图

鸿蒙第18课手表心率曲线图

作者: 游私塾白书生 | 来源:发表于2022-06-26 23:42 被阅读0次

1.hml

2.css

3.js

export default {

    data: {

        title: 'World',

//        圆形选择器

    options:{

        xAxis:{},

        yAxis:{min:0,max:230}

    },

//        数据集

        datasets : [{

        gradient:true,  //设置是否显示为渐变的颜色

        data:[50,90,120,115,99,120,126,116,105,104,122,109,111]

    }]

    },

    onInit(){

//        循环100次 将随机数放到数组内

        for (var i = 0; i < 100; i++) {

//                把数组的内容填满

            this.datasets[0].data.push(this.getRandInter(80,200));

        }

    },

//js中随机生成的函数  min  max(都包括 )的一个随机数

        getRandInter(min ,max){

            return Math.floor(Math.random()*(max-min+1))+min;

        }

}

相关文章

网友评论

      本文标题:鸿蒙第18课手表心率曲线图

      本文链接:https://www.haomeiwen.com/subject/zzakvrtx.html