我的laravel数组的格式错误,Chartist.js脚本无法将其作为标签处理。因为我的标签是字符串(销售人员姓名),所以它们用引号引起来,并且从来没有被图表专家正确地阅读。
我尝试将编码编码为json并将“替换为',但它们仍被读取为 " Sales Person "字符串值。
数字工作正常,但是Chartist很难使用字符串。
Laravel系列
$advisors_raw = Paymentplan::distinct()->whereNotNull('owner')->orderBy('owner', 'asc')->pluck('owner');
不会读取数组的Chartist脚本:
new Chartist.Bar('#chart3', {
labels: [{{$advisors_raw}}],
series: [{{$pruchase_total_2019}}],
});
相关分类