《开源精选》是我们分享Github、Gitee等开源社区中优质项目的栏目,包括技术、学习、实用与各种有趣的内容。本期推荐的是一个ReportPlus数据报表中心小程序。
原生uCharts下载
全端全平台支持,开箱即用,支持PC、H5、小程序(微信/支付宝/百度/头条/飞书/QQ/快手/钉钉/淘宝/京东)、Vue、Taro等更多支持canvas的框架,体积小巧、调用简单方便、性能及体验极佳。
https://www.npmjs.com/package/@qiun/ucharts
uCharts组件下载
相比原生 uCharts 具有使用方便、调用简单、页面简洁等特点。假如您是新手,那么一定要先从组件入手,因为官方组件已经替您写好了一些常用的方法,避开了一些平台的坑,您只需专注业务及数据,不必再为原生开发踩坑浪费时间。
https://www.npmjs.com/~qiun
由于其他图表都有对应的插件文件,所以仅对data-progress和text-block封装的参数做说明
进度条 (data-progress)
params类型说明dataTypestring不传表示不展示目标值和现在值,传则展示expectstring目标值nowstring现在达成值valuestring现在达成值/目标值
文本块 (text-block)
params类型说明kindstring表示使用哪种类型的文本块backgroundstring背景颜色contentarray该文本框内文本内容
{ "kind":1, "background":["#3EB2F5","#9374F7"], "content":[ {"text":"","value":"5860","colortext":"","colorvalue":"#fff","size":"44rpx"}, {"text":"新增微好友","value":"","colortext":"#fff","colorvalue":"","size":"24rpx"} ]}
{ "kind":2, "background":["#B678FD","#4A64F9"], "content":[ {"text":"环比增长","value":"3.2%","colortext":"#fff","colorvalue":"#fff","size":"24rpx"}, {"text":"同比增长","value":"1.1%","colortext":"#fff","colorvalue":"#fff","size":"24rpx"} ]}
{ "kind":3, "background":["#B678FD","#4A64F9"], "content":[ {"text":"","value":"38%","colortext":"","colorvalue":"#fff","size":"44rpx"}, {"text":"小程序购买活跃会员占比","value":"","colortext":"#fff","colorvalue":"","size":"24rpx"}, {"text":"同比","value":"2.5%","colortext":"#fff","colorvalue":"#fff","size":"20rpx"}, {"text":"环比","value":"3.2%","colortext":"#fff","colorvalue":"#fff","size":"20rpx"} ]}
{ "kind":4, "background":["#F0F0F0","#F0F0F0"], "content":[ {"text":"已评价数","value":"","colortext":"#000","colorvalue":"","size":"24rpx"}, {"text":"","value":"161","colortext":"","colorvalue":"#09A1FD","size":"44rpx"}, {"text":"增长","value":"","colortext":"#000","colorvalue":"","size":"20rpx"}, {"text":"up","value":"325","colortext":"#DF297D","colorvalue":"#f25287","size":"20rpx"} ]}
{ "kind":5, "background":["#F77E89","#F7953B"], "content":[ {"text":"会员销售占比","value":"","colortext":"#fff","colorvalue":"","size":"24rpx"}, {"text":"","value":"80%","colortext":"","colorvalue":"#fff","size":"44rpx"}, {"text":"环比","value":"81.5%","colortext":"#fff","colorvalue":"#fff","size":"20rpx"}, {"text":"同比","value":"-81.3%","colortext":"#fff","colorvalue":"#fff","size":"20rpx"}, {"text":"平均参考水平","value":"85%","colortext":"#fff","colorvalue":"#fff","size":"20rpx"} ]},
问题一:图表偶尔加载不出或直接显示报错页面
问题二:图表点击显示不出提示信息或点击位置不精准
-END-
开源协议:MIT
开源地址:
https://gitee.com/ureport/ReportPlus