/**
 * 计量信息-图表-进场车次时间分布
 */

import React from 'react';
import * as echarts from 'echarts';
import ReactEcharts from 'echarts-for-react';
import SubTitle from '../../../vm-sub-title';

const ChartJccc = () => {
    let option = {
        tooltip: {
            trigger: 'axis',
        },
        grid: {
            left: '5%',
            right: '5%',
            bottom: 20,
        },
        legend: {
            show: false,
        },
        xAxis: [
            {
                type: 'category',
                data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'],
                axisPointer: {
                    type: 'shadow',
                },
                axisTick: {
                    show: false,
                },
                axisLabel: {
                    color: '#fff',
                },
            },
        ],
        yAxis: [
            {
                type: 'value',
                name: '(次)',
                min: 0,
                interval: 100,
                nameTextStyle: {
                    color: '#fff',
                },
                splitNumber: 5,
                axisTick: {
                    show: false,
                },
                axisLabel: {
                    color: '#fff',
                },
                splitLine: {
                    lineStyle: {
                        type: 'dashed',
                        color: 'rgba(151,151,151,0.28)',
                    },
                },
            },
        ],
        series: [
            {
                type: 'bar',
                barWidth: 14,
                data: [20, 49, 70, 232, 256],
                itemStyle: {
                    color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
                        {
                            offset: 0,
                            color: '#1B89FF',
                        },
                        {
                            offset: 1,
                            color: '#51D0FF',
                        },
                    ]),
                },
            },
        ],
    };
    return (
        <>
            <SubTitle title="进场车次时间分布" />
            <div className="metering-content-charts-jccc-desc">
                进场高峰集中在8-10点、12-14点，进场车次分别为92次、86次，注意合理调度，
                缓解厂区排队情况。
            </div>
            <div className="metering-content-charts-chart">
                <ReactEcharts
                    option={option}
                    notMerge
                    lazyUpdate
                    style={{ height: '300px', width: '100%' }}
                />
            </div>
        </>
    );
};

export default ChartJccc;
