zoukankan      html  css  js  c++  java
  • echarts移动端demo

    说明:建议移动端使用的时候自己定制需要的东西,详情看官网  

    Fork me on GitHub

    效果图:

    代码:

    <!DOCTYPE html>
    <html style="height: 100%">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport"
              content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width"/>
        <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    </head>
    <body style="height: 100%; margin: 0">
    
    
    <div id="container" style="height: 50%; 100%;"></div>
    
    
    
    <script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/echarts.min.js"></script>
    <script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts-gl/echarts-gl.min.js"></script>
    <script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts-stat/ecStat.min.js"></script>
    <script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/extension/dataTool.min.js"></script>
    <script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/map/js/china.js"></script>
    <script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/map/js/world.js"></script>
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=ZUONbpqGBsYGXNIYHicvbAbM"></script>
    <script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/extension/bmap.min.js"></script>
    <script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/simplex.js"></script>
    <script type="text/javascript">
        var dom = document.getElementById("container");
        var myChart = echarts.init(dom);
        var app = {};
        option = null;
        app.title = '世界人口总量 - 条形图';
    
        option = {
            title: {
                text: '世界人口总量',
                subtext: '数据来自网络'
            },
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'shadow'
                }
            },
            legend: {
                data: ['2011年', '2012年']
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            xAxis: {
                type: 'value',
                boundaryGap: [0, 0.01]
            },
            yAxis: {
                type: 'category',
                data: ['巴西','印尼','美国','印度','中国','世界人口(万)']
            },
            series: [
                {
                    name: '2011年',
                    type: 'bar',
                    data: [18203, 23489, 29034, 104970, 131744, 630230]
                },
                {
                    name: '2012年',
                    type: 'bar',
                    data: [19325, 23438, 31000, 121594, 134141, 681807]
                }
            ]
        };
        ;
        if (option && typeof option === "object") {
            myChart.setOption(option, true);
        }
    
    
        window.onresize = function () {
            myChart.resize(); //使第一个图表适应
        }
    </script>
    </body>
    </html>

    x轴字体倾斜45度:

     xAxis: {
                type: 'value',
                boundaryGap: [0, 0.01],
                axisLabel: {
                    interval:0,
                    rotate:20//角度顺时针计算的
                }
            },
  • 相关阅读:
    卡特兰数,高精度卡特兰数
    SqlServer表中两条全然同样的记录,怎样删除当中1条
    微信.NET 微信开发 自己主动内容回复 ASP.NET C#代码
    RadHat搭建内网YUM源server
    2014上海全国邀请赛题解 HDOJ 5090-5099
    Enum枚举类|注解Annotation
    Galera 10.0.20 on CentOS 6.6
    CSS布局那点事儿
    利用CSS制作脸书
    《民国枭雄杜月笙》—— 听后总结
  • 原文地址:https://www.cnblogs.com/zxyun/p/9367273.html
Copyright © 2011-2022 走看看