<?php
/**
 * 新增产品型号汇总
 */
$sql = <<<EOFSQL
SELECT
{:axis},
{:series},
count(DISTINCT sku) sku
FROM gspcatalog_bi.sum_pro_new
WHERE 1
{:where}
GROUP BY {:axis}
ORDER BY {:axis}
EOFSQL;

return [
    'options'=>[
        //轴列
        'axis'=>['month','year','bigcate','cate','state','region_s','make'],
        //维度
        'series'=>['year','month','bigcate','cate','state','region_s','make'],
        //条件
        'search'=>['year','month','bigcate','cate','state','region_s','make'],
    ],
    'table'=>'sum_pro_new',
    'sql'=>$sql,
    'fields'=>[
        'axis'=>'month',
        'value'=>'sku',
    ],
    //'countSql'=>$countSql,
    //'maxCountSql'=>'', //其他统计
    //'series'=>'year', //维度
    'echarts'=>[
        'title'=>[
            'text'=>lg('新增型号趋势'),
            'textStyle'=> $style['title']['textStyle'],
        ],
        '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'=>['top'=>'22'],
        'grid'=>['top'=>'75', 'left'=>'2%', 'right'=>'2%', 'bottom'=>'2%', 'containLabel'=>true],
        'xAxis'=>[
            'type'=>'category',
            'data'=>[],
            'axisPointer'=>['type'=>'shadow'],
        ],
        'yAxis'=>[
            'type'=>'value',
        ],
        'series'=>[
            [
                'name'=>'SKU',
                'data'=>[],
                'type'=>'bar',
            ],
       ]//series
    ],
];