<?php
$sql = <<<EOFSQL
SELECT 
{:axis},
SUM(vio_qty) vio_qty 
FROM sum_vio WHERE 1 {:where} GROUP BY {:axis}
EOFSQL;

return [
    'options'=>[
        //轴列
        //'axis'=>['vio_fac', 'vio_region_s', 'vio_age'],
        //维度
        //'series'=>['vio_fac'],
        //条件
        //'search'=>['vio_fac','vio_country', 'vio_region_s', 'vio_age'],
    ],
    'table'=>'sum_vio',
    'sql'=>$sql,
    'fields'=>[
        'axis'=>'vio_fac',
        'value'=>'vio_qty',
    ],
    //'countSql'=>$countSql,
    //'maxCountSql'=>'', //其他统计
    'series'=>'vio_fac', //维度
    'echarts'=>[
        'title'=>['text'=>lg('VIO汇总'),],
        'tooltip'=>[
            'trigger'=>'axis',
            'axisPointer'=>['type'=>'shadow'],
        ],
        'toolbox'=>[
            'feature'=>[
                'dataView'=>['show'=>true,'readOnly'=>true],
                'magicType'=>['show'=>true,'type'=>['line', 'bar']],
                'restore'=>['show'=>true],
                'saveAsImage'=>['show'=>true],
            ]
        ],
        //'legend'=>['data'=>['2020','2021']],
        //'grid'=>['left'=>'23%', 'right'=>'5%', 'bottom'=>'10%', 'containLabel'=>false],
        'xAxis'=>[
            'type'=>'category',
            'data'=>[],
            'axisPointer'=>['type'=>'shadow'],
        ],
        'yAxis'=>[
            'type'=>'value',
        ],
        'series'=>[
            [
                'name'=>'VIO',
                'data'=>[],
                'type'=>'bar',
            ],
       ]//series
    ],
];