laravel-charts icon indicating copy to clipboard operation
laravel-charts copied to clipboard

Backward compatible for non-English chart title

Open Mowd opened this issue 2 years ago • 0 comments
trafficstars

If non-English string is apply to chart title, the chart won't show anything and comes with javascript error Reproduce:

$chart_options = [
            'chart_title' => '標題', //which is Chinese string
            'report_type' => 'group_by_date',
            'model' => 'App\Models\users',
            'group_by_field' => 'update_at',
            'group_by_period' => 'week',
            'chart_type' => 'bar',
        ];

This PR will check the chart title is empty or not, then fall back to the original characters without slugify it.

Mowd avatar Aug 28 '23 12:08 Mowd