LaravelDaily / laravel-charts

Package to draw charts in Laravel with Chart.js
MIT License
531 stars 118 forks source link

Backward compatible for non-English chart title #114

Open Mowd opened 1 year ago

Mowd commented 1 year ago

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.