echart实现手机端折线图饼状图统计图表效果代码

代码语言:html

所属分类:布局界面

代码描述:echart实现手机端折线图饼状图统计图表效果代码

代码标签: 端折 线图 饼状 统计 图表 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <style>
        * {
            margin: 0;
            padding: 0;
            border: 0;
            list-style: none;
            text-decoration: none;
            color: inherit;
            font-weight: normal;
            font-family: "微软雅黑";
            box-sizing: border-box;
            font-style: normal;
            outline: none;
        }
        body {
            width: 100%;
            overflow-x: hidden;
            background: #0f113a;
            background-size: 100%;
        }
        img {
            vertical-align: middle;
            max-width: 100%;
        }
        a:hover,a:active,a:visited,a:link,a:focus {
            -webkit-tap-highlight-color: transparent;
            outline: none;
            text-decoration: none;
        }
        /*顶部标题 更多*/
        .top {
            position: absolute;
            top: .15rem;
            left: 0;
            height: .9rem;
            line-height: .9rem;
            width: 100%;
            text-align: center;
            font-size: .36rem;
            color: #FFFFFF;
        }
        .top i {
            background: url(../images/icon-left.png) center left no-repeat;
            position: absolute;
            top: 0;
            left: .2rem;
            height: 100%;
            display: inline-block;
            background-size: .36rem .25rem;
            width: .5rem;
            height: 100%;
        }
        /*图表*/
        .chart {
            width: 100%;
            padding: 0 .2rem;
        }
        .chart.one {
            height: 5.1rem;
            margin-bottom: .35rem;
            margin-top: 1.4rem;
        }
        .chart.two {
            height: 5.5rem;
        }
        #chartOne,#chartTwo {
            width: 100%;
            height: 100%;
            background: #0e1233;
            padding: .4rem .3rem;
        }

    </style>
    <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/flexible.js"></script>
    <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/echarts.js"></script>
</head>
<body>
    <!--顶部-->
    <div class="top">
        <i></i>人流量统计
    </div>
    <!--图表1-->
    <div class="chart one">
        <div id="chartOne"></div>
    </div>
    <!--图表2-->
    <div class="chart two">
        <div id="chartTwo"></div>
    </div>
    <script>
        //图表1
        var chartOne = echarts.init(document.getElementById('chartOne'), null, {
            renderer: 'svg'
        });
        var chartOneOptions = {
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'shadow',
                    shadowStyle: {
                        color: 'rgba(14,34,68,.5)',
                        shadowColor: 'rgba(14,34,68,.1)',
                        shadowBlur: 5
                    }
                },
            },
            legend: {
                left: '0',
                align: 'left',
                top: '0',
                textStyle: {
                    color: '#fff'
                },
            },
            grid: {
                top: '20%',
                left: '0',
                right: '3%',
                bottom: '5%',
                containLabel: true
            },
            xAxis: [{
                type: 'category',
                axisLine: {
                    show: true,
                    lineStyle: {
                        type: 'solid',
                        color: '#1aaed7',
                        width: '2'
                    }
                },
                axisTick: {
                    "show": false
                },
                axisLabel: {
                    color: '#1aaed7',
                    width: 100
                },
                splitLine: {
                    show: false
                },
                boundaryGap: false,
                data: ["周一",
                    "周二",
                    "周三",
                    "周四",
                    "周五"]

            }],

            yAxis: [{
                type: 'value',
                min: 0,
                max: 120,
                splitNumber: 6,
                splitLine: {
                    show: true,
                    lineStyle: {
                        color: '#0e2244'
                    }
                },
                axisLine: {
                    show: false,
                },
                axisLabel: {
                    show: true,
                    margin: 20,
                    textStyle: {
                        color: '#1aaed7',

                    },
                },
                axisTick: {
                    show: false,
                },
            }],
            series: [{
                name: '本周',
                type: 'line',
                showAllSymbol: true,
                symbol: 'circle',
                symbolSize: 10,
                lineStyle: {
                    normal: {
                        color: "#A582EA",
                    },
                },
                label: {
                    show: false
                },
                itemStyle: {
                    color: "rgba(89,47,180,1)",
                    borderColor: "rgba(89,47,180,.3)",
                    borderWidth: 8
                },
                areaStyle: {
                    normal: {
                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                            offset: 0,
                            color: 'rgba(89,47,180,0.8)'
            .........完整代码请登录后点击上方下载按钮下载查看

网友评论0