fastmock 模拟数据 echarts 可视化实例

本文详细介绍了如何利用FastMock生成模拟数据,并结合ECharts进行数据可视化。首先,通过FastMock设置接口返回动态模拟数据,然后在前端项目中引入ECharts库,配置图表参数,将模拟数据绑定到ECharts图表上,实现动态数据展示。最后展示了具体的数据可视化效果和代码示例。
摘要由CSDN通过智能技术生成
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/echarts/4.3.0/echarts.min.js"></script>
</head>
<style>
    * {
        margin: 0;
        padding: 0;
    }
    
    .content {
        border: 1px solid rgb(117, 193, 251);
        width: 110vh;
        height: 90vh;
        margin: 10px auto;
        padding: 10px;
    }
    
    .title h3 {
        margin-left: 2em;
        position: relative;
        width: 8em;
        height: 2.5em;
        line-height: 2.5em;
        background-color: rgb(117, 193, 251);
        color: #fff;
        text-align: center;
    }
    
    .title h3:before {
        content: "";
        position: absolute;
        top: 0;
        left: -1em;
        width: 0;
        height: 0;
        border-top: 1.25em solid transparent;
        border-right: 1em solid rgb(117, 193, 251);
        border-bottom: 1.25em solid transparent;
    }
    
    .title h3:after {
        content: "";
        position: absolute;
        top: 0;
        right: -1em;
        width: 0;
        height: 0;
        border-bottom: 1.25em solid transparent;
        border-left: 1em solid rgb(117, 193, 251);
        border-top: 1.25em solid transparent;
    }
    
    .proportion,
    .charges {
        margin-bottom: 10px;
    }
    
    #proportion-chart1,
    #proportion-chart2 {
        display: inline-block;
        width: 35%;
        height: 30vh;
    }
    
    #Pselect {
        display: inline-block;
        width: 25%;
        height: 30vh;
        vertical-align: top;
    }
    
    #Pselect select {
        display: block;
        width: 6em;
        height: 2em;
        margin: 6vh auto;
        text-align: center;
        text-align-last: center;
        outline: none;
        border: 1px solid #277de2;
    }
    
    .charges select {
        display: inline-block;
        vertical-align: top;
        width: 6em;
        height: 2em;
        text-align: center;
        text-align-last: center;
        outline: none;
        border: 1px solid #277de2;
    }
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值