用reveal.js写个小小的展示

用reveal.js+echarts.js+mock.js写个小小的展示,本文不分享技术知识,只是试一下第一次在掘金上发文章,有兴趣的道友就看看,没兴趣的请直接略过,勿喷。

只贴mock部分的代码,有兴趣想看看完整代码的 请点这里

line

 var mockData = Mock.mock({
        "chartData|2-10": [
            {
                "cate": () => {
                    return Mock.Random.province()
                },
                "data|7": [
                    () => {
                        return Mock.Random.integer(0, 3000)
                    }
                ]
            }
        ]
    });
复制代码

polar

 var mockData = Mock.mock({
        "chartData|2-10": [
            {
                "cate": () => {
                    return Mock.Random.province()
                },
                "data|7": [
                    () => {
                        return Mock.Random.integer(0, 3000)
                    }
                ]
            }
        ]
    });
复制代码

tree

 var mockData = Mock.mock({
        "chartData|2-10": [
            {
                "name": () => {
                    return Mock.Random.last()
                },
                "children|0-10": [
                    {
                        "name": () => {
                            return Mock.Random.last()
                        },
                        "children|0-10": [
                            {
                                "name": () => {
                                    return Mock.Random.last()
                                },
                                "children|0-10": [
                                    {
                                        "name": () => {
                                            return Mock.Random.last()
                                        },
                                        "value|1-10000": 1
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        ]
    });
复制代码

color

 var mockData = Mock.mock({
        "chartData|10-25": [
            {
                "name": () => {
                    return Mock.Random.first()
                },
                "itemStyle": {
                    "color": () => {
                        return Mock.Random.color()
                    }
                },
                "children|0-2": [
                    {
                        "name": () => {
                            return Mock.Random.first()
                        },
                        "itemStyle": {
                            "color": () => {
                                return Mock.Random.color()
                            }
                        },
                        "children|0-5": [
                            {
                                "name": () => {
                                    return Mock.Random.first()
                                },
                                "itemStyle": {
                                    "color": () => {
                                        return Mock.Random.color()
                                    }
                                },
                                "value|1": 1
                            }
                        ]
                    }
                ]
            }
        ]
    });
复制代码

scatter

 var mockData = Mock.mock({
        "chartData|100-1000": [
            [
                () => {
                    return Mock.Random.float(100, 200, 2, 2)
                },
                () => {
                    return Mock.Random.float(0, 150, 2, 2)
                }
            ]
        ]
    });
复制代码

就这些了,谢谢观看!

你可能感兴趣的:(用reveal.js写个小小的展示)