<template>
    <div class="container">
        <div id="ERight1" style="height:100%;"></div>
    </div>
</template>

<script>
export default {
    name: "ERight1",
    data() {
        return {};
    },
    mounted() {
        this.drawChart();
    },
    methods: {
        drawChart() {
            // 基于准备好的dom，初始化echarts实例
            let myChart = this.$echarts.init(document.getElementById("ERight1"));
            // 指定图表的配置项和数据
            let option = {
                color: ["#147CE3"],
                tooltip: {
                    trigger: "axis",
                    textStyle: {
                        fontSize: 20,
                        color: "#fff"
                    }
                },
                grid: {
                    x: "5%",
                    y: "5%",
                    x2: "8%",
                    y2: "13%",
                    containLabel: true,
                },
                calculable: true,
                yAxis: {
                    nameTextStyle: {
                        fontSize: 20,
                        color: "#fff",
                    },
                    type: "category",
                    data: ["运输中", "已收货", "未收货"],
                    textStyle: {
                        fontSize: 20,
                        color: "#fff",
                    },
                    axisLabel: {
                        textStyle: {
                            fontSize: 20,
                            color: "#fff"
                        },
                    },
                },

                xAxis: {
                    name: "(数量)",
                    nameTextStyle: {
                        fontSize: 20,
                        color: "#fff",
                    },
                    type: "value",
                    axisLabel: {
                        textStyle: {
                            fontSize: 20,
                            color: "#fff"
                        },
                    },
                },
                series: [
                    {
                        name: "公羊",
                        type: "bar",
                        barWidth: "50%",
                        data: [155, 126, 328]
                    }
                ],
            };
            // 使用刚指定的配置项和数据显示图表。
            myChart.setOption(option);
        },
    },
};
</script>

<style lang="scss" scoped>
</style>