当前位置: 首页 > news >正文

HarmonyOS开发之Gauge(环形图表)的简单使用

效果图:

代码块:

@Entry
@Component
struct GaugePage {@Builder descriptionBuilder() {Text('优').maxFontSize(30).minFontSize(30).fontColor("#fffa2a2d").fontWeight(FontWeight.Medium).width('100%').height("100%").textAlign(TextAlign.Center)}build() {Column() {Gauge({ value: 50}) {Column() {Text('50').maxFontSize(80).minFontSize(60).fontWeight(FontWeight.Medium).fontColor("#ff182431").width('40%').height('30%').textAlign(TextAlign.Center).margin({ top: '22.2%' }).textOverflow({ overflow: TextOverflow.Ellipsis }).maxLines(1)Text('空气质量').maxFontSize("16.0fp").minFontSize("10.0vp").fontColor($r('sys.color.ohos_id_color_text_secondary')).fontColor($r('sys.color.ohos_id_color_text_secondary')).fontWeight(FontWeight.Regular).width('67.4%').height('9.5%').textAlign(TextAlign.Center)}.width('100%').height('100%')}.startAngle(225).endAngle(135).colors(new LinearGradient([{ color: "#e84026", offset: 0 },{ color: "#f7ce00", offset: 0.6 },{ color: "#64bb5c", offset: 1 }])).width('80%').height('80%').strokeWidth(18).trackShadow({ radius: 7, offsetX: 7, offsetY: 7 }).description(this.descriptionBuilder).padding(18)}.margin({ top: 40 }).width('100%').height('100%')}
}


http://www.mrgr.cn/news/12271.html

相关文章:

  • Python | Leetcode Python题解之第373题查找和最小的K对数字
  • 【iOS】Masonry学习
  • 前端实习手记(9):修修修修bug
  • 二叉树的三个简单题
  • 速盾:cdn可以解决带宽问题么
  • GalaChain 全面剖析:为 Web3 游戏和娱乐而生的创新区块链
  • QT中通过Tcp协议的多线程的文件传输(服务器)
  • 3 Docker 镜像推送
  • 鸿蒙验证码,鸿蒙认证服务验证码,鸿蒙云存储上传图片
  • 华裔二、三代长相变迁的多维度解析
  • 利用深度学习技术来实现街景图像的语义分割(街景图像语义分割)
  • 如何使用 Nginx 解决跨域问题 (CORS)
  • uni-app - - - - - 自定义tabbar
  • 使用 OpenCV 组合和缩放多张图像
  • DDPM/DDIM去噪扩散概率模型和GANs
  • 查看redis节点的连接数
  • 多态(c++)
  • pytorch深度学习基础 8(CIFRA-10基础篇1)
  • 常用的 Redis 配置命令
  • 述FunsorFunsor是一个类似张量的函数和分布库。概率规划的泛函张量获取系统描述 ppl,pyro的衍生项目,人工智能python编程 ,深度神经网络