赞
踩
低性能、高兼容uCharts写法:
<qiun-data-charts type="pie" :chartData="chartData" :opts="{legend:{show:false}}"/>
高性能、低兼容eCharts写法:
<qiun-data-charts type="pie" :chartData="chartData" :eopts="{legend:{show:false}}" :echartsH5="true" :echartsApp="true" background="none"/>
完整代码for eCharts
- <template>
- <view>
-
- <view class="charts-box" style="height: 300px; width: 100%;">
-
- <qiun-data-charts
- type="pie"
- :chartData="chartData"
- :echartsH5="true"
- :echartsApp="true"
- background="none"
- :eopts="{legend:{show:false}}"
- />
-
- </view>
-
- </view>
- </template>
-
- <script>
- export default {
- data() {
- return {
- chartData: {
- "series": [
- {
- "data": [
- {
- "name": "一班",
- "value": 50
- },
- {
- "name": "二班",
- "value": 30
- },
- {
- "name": "三班",
- "value": 20
- },
- {
- "name": "四班",
- "value": 18
- },
- {
- "name": "五班",
- "value": 8
- }
- ]
- }
- ]
- }
- }
- },
- methods: {
-
-
- }
- }
- </script>
-
- <style>
-
- </style>
uCharts效果:
eCharts效果:
- "pie": {
- "color": color,
- "title": {
- "text": ''
- },
- "tooltip": {
- "trigger": 'item'
- },
- "grid": {
- "top": 40,
- "bottom": 30,
- "right": 15,
- "left": 15
- },
- "legend": {
- "show": false,
- "bottom": 'left',
- },
如果没有生效,同样方法炮制:
\uni_modules\qiun-data-charts\js_sdk\u-charts\config-ucharts.js
uCharts®高性能跨平台图表库,支持H5、APP、小程序(微信/支付宝/百度/头条/QQ/360)、Vue、Taro等支持canvas的框架平台
uCharts®官方网站
https://www.uCharts.cn
uni-app插件市场地址:
http://ext.dcloud.net.cn/plugin?id=271
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。