状态时长图完整配置

{
    "backgroundColor": "#fff",
    "color": [
        "#88AAFF",
        "#9AE9A1",
        "#6FD4D6",
        "#F5D45F",
        "#F4928B",
        "#DAA78E",
        "#FB7293",
        "#E062AE",
        "#E690D1",
        "#E7BCF3",
        "#9D96F5",
        "#8378EA"
    ],
    "title": {
        "show": true,
        "text": "状态时长分布图",
        "textStyle": {
            "fontFamily": "Microsoft YaHei,PingFang SC Regular",
            "fontWeight": "800",
            "fontSize": 14,
            "color": "#666"
        },
        "left": 0,
        "top": 0
    },
    "grid": [
        {
            "left": "80px",
            "right": "70px",
            "bottom": "60px",
            "top": "50px"
        }
    ],
    "legend": {
        "show": true,
        "textStyle": {
            "color": "#666"
        },
        "orient": "horizontal",
        "left": "center",
        "bottom": 0
    },
    "dataZoom": [
        {
            "show": false,
            "height": 20,
            "start": 0,
            "end": 100,
            "bottom": 22
        }
    ],
    "tooltip": {
        "show": true,
        "textStyle": {
            "fontSize": 12,
            "color": "#666"
        },
        "confine": true,
        "backgroundColor": "#fff",
        "borderColor": "#fff",
        "triggerOn": "mousemove"
    },
    "xAxis": [
        {
            "type": "time",
            "name": "",
            "show": true,
            "splitLine": {
                "show": false,
                "lineStyle": {
                    "color": "#ccc",
                    "type": "dashed"
                }
            },
            "axisLine": {
                "show": true,
                "margin": 8,
                "lineStyle": {
                    "textAlign": "left",
                    "color": "#ccc"
                }
            },
            "axisLabel": {
                "show": true,
                "rotate": "0",
                "textStyle": {
                    "fontSize": 12,
                    "color": "#666"
                }
            },
            "axisTick": {
                "alignWithLabel": false
            }
        }
    ],
    "yAxis": {
        "data": [
            "设备1",
            "设备2"
        ],
        "show": true,
        "name": "",
        "splitLine": {
            "show": true,
            "lineStyle": {
                "color": "#ccc",
                "type": "dashed"
            }
        },
        "axisLine": {
            "show": true,
            "lineStyle": {
                "color": "#ccc"
            }
        },
        "axisLabel": {
            "formatter": "{value}",
            "show": true,
            "textStyle": {
                "fontSize": 12,
                "color": "#666"
            }
        }
    },
    "series": [
        {
            "type": "custom",
            "encode": {
                "x": [
                    1,
                    2
                ],
                "y": 0
            },
            "data": [
                {
                    "state": "正常",
                    "states": "正常",
                    "names": "设备1",
                    "value": [
                        0,
                        1616728225000,
                        1616728226000
                    ],
                    "itemStyle": {
                        "normal": {
                            "color": {
                                "x": "0",
                                "y": "0",
                                "x2": "1",
                                "y2": "0",
                                "type": "linear",
                                "global": false,
                                "colorStops": [
                                    {
                                        "offset": 0,
                                        "color": "rgba(136,170,255,1)"
                                    },
                                    {
                                        "offset": 1,
                                        "color": "rgba(136,170,255,1)"
                                    }
                                ]
                            }
                        }
                    }
                },
                {
                    "state": "正常",
                    "states": "正常",
                    "names": "设备1",
                    "value": [
                        1,
                        1616728225000,
                        1616728230000
                    ],
                    "itemStyle": {
                        "normal": {
                            "color": {
                                "x": "0",
                                "y": "0",
                                "x2": "1",
                                "y2": "0",
                                "type": "linear",
                                "global": false,
                                "colorStops": [
                                    {
                                        "offset": 0,
                                        "color": "rgba(136,170,255,1)"
                                    },
                                    {
                                        "offset": 1,
                                        "color": "rgba(136,170,255,1)"
                                    }
                                ]
                            }
                        }
                    }
                },
                {
                    "state": "等待",
                    "states": "等待",
                    "names": "设备2",
                    "value": [
                        0,
                        1616728227000,
                        1616728229000
                    ],
                    "itemStyle": {
                        "normal": {
                            "color": {
                                "x": "0",
                                "y": "0",
                                "x2": "1",
                                "y2": "0",
                                "type": "linear",
                                "global": false,
                                "colorStops": [
                                    {
                                        "offset": 0,
                                        "color": "rgba(154,233,161,1)"
                                    },
                                    {
                                        "offset": 1,
                                        "color": "rgba(154,233,161,1)"
                                    }
                                ]
                            }
                        }
                    }
                },
                {
                    "state": "等待",
                    "states": "等待",
                    "names": "设备2",
                    "value": [
                        1,
                        1616728230000,
                        1616728235000
                    ],
                    "itemStyle": {
                        "normal": {
                            "color": {
                                "x": "0",
                                "y": "0",
                                "x2": "1",
                                "y2": "0",
                                "type": "linear",
                                "global": false,
                                "colorStops": [
                                    {
                                        "offset": 0,
                                        "color": "rgba(154,233,161,1)"
                                    },
                                    {
                                        "offset": 1,
                                        "color": "rgba(154,233,161,1)"
                                    }
                                ]
                            }
                        }
                    }
                },
                {
                    "state": "错误",
                    "states": "错误",
                    "value": [
                        0,
                        1616728231000,
                        1616728238000
                    ],
                    "itemStyle": {
                        "normal": {
                            "color": {
                                "x": "0",
                                "y": "0",
                                "x2": "1",
                                "y2": "0",
                                "type": "linear",
                                "global": false,
                                "colorStops": [
                                    {
                                        "offset": 0,
                                        "color": "rgba(111,212,214,1)"
                                    },
                                    {
                                        "offset": 1,
                                        "color": "rgba(111,212,214,1)"
                                    }
                                ]
                            }
                        }
                    }
                },
                {
                    "state": "错误",
                    "states": "错误",
                    "value": [
                        1,
                        1616728246000,
                        1616728255000
                    ],
                    "itemStyle": {
                        "normal": {
                            "color": {
                                "x": "0",
                                "y": "0",
                                "x2": "1",
                                "y2": "0",
                                "type": "linear",
                                "global": false,
                                "colorStops": [
                                    {
                                        "offset": 0,
                                        "color": "rgba(111,212,214,1)"
                                    },
                                    {
                                        "offset": 1,
                                        "color": "rgba(111,212,214,1)"
                                    }
                                ]
                            }
                        }
                    }
                },
                {
                    "state": "正常",
                    "states": "正常",
                    "names": "设备1",
                    "value": [
                        0,
                        1616728238000,
                        1616728248000
                    ],
                    "itemStyle": {
                        "normal": {
                            "color": {
                                "x": "0",
                                "y": "0",
                                "x2": "1",
                                "y2": "0",
                                "type": "linear",
                                "global": false,
                                "colorStops": [
                                    {
                                        "offset": 0,
                                        "color": "rgba(136,170,255,1)"
                                    },
                                    {
                                        "offset": 1,
                                        "color": "rgba(136,170,255,1)"
                                    }
                                ]
                            }
                        }
                    }
                },
                {
                    "state": "正常",
                    "states": "正常",
                    "names": "设备1",
                    "value": [
                        1,
                        1616728256000,
                        1616728261000
                    ],
                    "itemStyle": {
                        "normal": {
                            "color": {
                                "x": "0",
                                "y": "0",
                                "x2": "1",
                                "y2": "0",
                                "type": "linear",
                                "global": false,
                                "colorStops": [
                                    {
                                        "offset": 0,
                                        "color": "rgba(136,170,255,1)"
                                    },
                                    {
                                        "offset": 1,
                                        "color": "rgba(136,170,255,1)"
                                    }
                                ]
                            }
                        }
                    }
                },
                {
                    "state": "错误",
                    "states": "错误",
                    "value": [
                        0,
                        1616728269000,
                        1616728277000
                    ],
                    "itemStyle": {
                        "normal": {
                            "color": {
                                "x": "0",
                                "y": "0",
                                "x2": "1",
                                "y2": "0",
                                "type": "linear",
                                "global": false,
                                "colorStops": [
                                    {
                                        "offset": 0,
                                        "color": "rgba(111,212,214,1)"
                                    },
                                    {
                                        "offset": 1,
                                        "color": "rgba(111,212,214,1)"
                                    }
                                ]
                            }
                        }
                    }
                },
                {
                    "state": "错误",
                    "states": "错误",
                    "value": [
                        1,
                        1616728267000,
                        1616728277000
                    ],
                    "itemStyle": {
                        "normal": {
                            "color": {
                                "x": "0",
                                "y": "0",
                                "x2": "1",
                                "y2": "0",
                                "type": "linear",
                                "global": false,
                                "colorStops": [
                                    {
                                        "offset": 0,
                                        "color": "rgba(111,212,214,1)"
                                    },
                                    {
                                        "offset": 1,
                                        "color": "rgba(111,212,214,1)"
                                    }
                                ]
                            }
                        }
                    }
                },
                {
                    "state": "错误",
                    "states": "错误",
                    "value": [
                        0,
                        1616728279000,
                        1616728279000
                    ],
                    "itemStyle": {
                        "normal": {
                            "color": {
                                "x": "0",
                                "y": "0",
                                "x2": "1",
                                "y2": "0",
                                "type": "linear",
                                "global": false,
                                "colorStops": [
                                    {
                                        "offset": 0,
                                        "color": "rgba(111,212,214,1)"
                                    },
                                    {
                                        "offset": 1,
                                        "color": "rgba(111,212,214,1)"
                                    }
                                ]
                            }
                        }
                    }
                },
                {
                    "state": "错误",
                    "states": "错误",
                    "value": [
                        1,
                        1616728278000,
                        1616728279000
                    ],
                    "itemStyle": {
                        "normal": {
                            "color": {
                                "x": "0",
                                "y": "0",
                                "x2": "1",
                                "y2": "0",
                                "type": "linear",
                                "global": false,
                                "colorStops": [
                                    {
                                        "offset": 0,
                                        "color": "rgba(111,212,214,1)"
                                    },
                                    {
                                        "offset": 1,
                                        "color": "rgba(111,212,214,1)"
                                    }
                                ]
                            }
                        }
                    }
                },
                {
                    "state": "等待",
                    "states": "等待",
                    "names": "设备2",
                    "value": [
                        0,
                        1616728289000,
                        1616728293000
                    ],
                    "itemStyle": {
                        "normal": {
                            "color": {
                                "x": "0",
                                "y": "0",
                                "x2": "1",
                                "y2": "0",
                                "type": "linear",
                                "global": false,
                                "colorStops": [
                                    {
                                        "offset": 0,
                                        "color": "rgba(154,233,161,1)"
                                    },
                                    {
                                        "offset": 1,
                                        "color": "rgba(154,233,161,1)"
                                    }
                                ]
                            }
                        }
                    }
                },
                {
                    "state": "等待",
                    "states": "等待",
                    "names": "设备2",
                    "value": [
                        1,
                        1616728281000,
                        1616728283000
                    ],
                    "itemStyle": {
                        "normal": {
                            "color": {
                                "x": "0",
                                "y": "0",
                                "x2": "1",
                                "y2": "0",
                                "type": "linear",
                                "global": false,
                                "colorStops": [
                                    {
                                        "offset": 0,
                                        "color": "rgba(154,233,161,1)"
                                    },
                                    {
                                        "offset": 1,
                                        "color": "rgba(154,233,161,1)"
                                    }
                                ]
                            }
                        }
                    }
                }
            ]
        }
    ]
}
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容