Skip to content

数据结构

M edited this page Mar 19, 2019 · 1 revision

常用数据模型

1.基础数据结构

[
    {
        "name": "直接访问",
        "value": 335
    },
    {
        "name": "邮件营销",
        "value": 310
    },
    {
        "name": "联盟广告",
        "value": 234
    },
    {
        "name": "视频广告",
        "value": 135
    },
    {
        "name": "搜索引擎",
        "value": 400
    },
]

2.二维表数据结构

    {
    "columns": [
        {
            "field": "xAxis",
            "name": "时间",
            "type": "string"
        },
        {
            "field": "email",
            "name": "邮件营销",
            "type": "string"
        },
        {
            "field": "union",
            "name": "联盟广告",
            "type": "string"
        },
        {
            "field": "video",
            "name": "视频广告",
            "type": "string"
        },
        {
            "field": "visit",
            "name": "直接访问",
            "type": "string"
        },
        {
            "field": "search",
            "name": "搜索引擎",
            "type": "string"
        }
    ],
    "rows": [
        {
            "xAxis": "周一",
            "email": 120,
            "union": 220,
            "video": 150,
            "visit": 30,
            "search": 820
        },
        {
            "xAxis": "周二",
            "email": 132,
            "union": 182,
            "video": 232,
            "visit": 332,
            "search": 932
        },
        {
            "xAxis": "周三",
            "email": 101,
            "union": 192,
            "video": 202,
            "visit": 302,
            "search": 902
        },
        {
            "xAxis": "周四",
            "email": 134,
            "union": 234,
            "video": 154,
            "visit": 334,
            "search": 934
        },
        {
            "xAxis": "周五",
            "email": 90,
            "union": 290,
            "video": 190,
            "visit": 390,
            "search": 1290
        },
        {
            "xAxis": "周六",
            "email": 230,
            "union": 330,
            "video": 330,
            "visit": 330,
            "search": 1230
        },
        {
            "xAxis": "周日",
            "email": 210,
            "union": 310,
            "video": 420,
            "visit": 320,
            "search": 1320
        }
    ]
}

3.树形结构

[
    {
        "name": "直达",
        "children": [
            { "value": 335, "name": "直达" },
        ]
    },
    {
        "name": "营销广告",
        "children": [
            { "value": 310, "name": "邮件营销" },
            { "value": 234, "name": "联盟广告" },
            { "value": 135, "name": "视频广告" },
        ]
    },
    {
        "name": "搜索引擎",
        "children": [
            { "value": 1048, "name": "百度" },
            { "value": 251, "name": "谷歌" },
            { "value": 147, "name": "必应" },
            { "value": 102, "name": "其他" }
        ]
    },

]
    {
        "data":{
            "columns": [
                {
                    "field": "title",
                    "name": "标题名",
                    "type": "string"
                },{
                    "field": "key",
                    "name": "key",
                    "type": "string"
                }
            ],
            "rows": [
                {
                    "title": "首页",
                    "key": "home"
                },{
                    "title": "汇总数据",
                    "key": "huizongshuju",
                    "children": [
                        {
                            "title": "交易",
                            "key": "jiaoyi"
                        },{
                            "title": "用户",
                            "key": "yonghu"
                        },{
                            "title": "存量",
                            "key": "cunliang"
                        }
                    ]
                },
                {
                    "title": "实时分析",
                    "key": "shishifenxi",
                    "children": [
                        {
                            "title": "实时概况",
                            "key": "shsihigaikuang"
                        }
                    ]
                },{
                    "title": "定期数据",
                    "key": "dingqishuju"
                }
            ]
        },
        "status":0
    }
Clone this wiki locally