当前位置:   article > 正文

Android ECharts折线、圆柱、饼状初步实现_android echarts 饼图

android echarts 饼图

做Android开发经常会需要画一些图表,ECharts就是很好用的一款第三方的框架

1、配置ECharts

echarts.min.js文件就需要你自己去下载啦,可以直接选择:

echart.html:

<!DOCTYPE html>
<html style="height: 100%">
    <head>
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <meta charset="utf-8">
    </head>
    <body style="height: 100%; margin: 0">
        <div id="container" style="height: 100%"></div>
        <script type="text/javascript" src="./echarts.min.js"></script>
        <script type="text/javascript">
            var dom =document.getElementById("container");
            var myChart =echarts.init(dom);
            var app ={};
            function loadEcharts(echartJson){
                var option = JSON.parse(echartJson);
                if (option &&typeof option ==="object") {
                    myChart.setOption(option,true);
                }
            }
        </script>
    </body>
</html>

2、添加依赖

    implementation 'com.github.abel533:ECharts:3.0.0.2'
    implementation 'com.google.code.gson:gson:2.8.6'

3、因为Echarts需要在WebView中显示,所以我们直接自定义一个Ech

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/254653
推荐阅读
相关标签
  

闽ICP备14008679号