apexcharts图表格式化数据

/**
*初始化图表数据
*/
protected function setUpoptions()
    $this->options([
        'chart'=[
            'type' => 'Line',
            'height' => 350,
            'zoom'=>[
            'lenabled'=> false
            ],
            'toolbar' =>[
            'show'=> true,

            ],

        ],
        'datalabels'=>[
            'enabled'=> true,
        ],
        'stroke'=>[
            'curve'=> 'smooth',
        ],
        'grid'=>[
            'row'=>[
                'colors'=> ['#ffffff', 'transparent'],
                'opacity'=> 0.2,
            ]
        ],
        'xaxis'=>[
            'categories'=>[],
        ]

    ]);

    $this->option('tooltip.y.formatter',JavaScript::make(script: "function(val){ return parseInt(val);)"));
    $this->option('yaxis.labels. formatter',Javaseript::make(script: "function(val){ return parseInt (val);"));
}

此处评论已关闭

[player id="719102"/]