I am trying to build a chart with Chart.js using laravel. The json_encode function returns a string with and quot; instead of "that Chart.js cannot recognize. Tried htmlspecialchars_decode () with no luck. Is there any other workaround? Please help.
This is the laravel code
labels: {{ htmlspecialchars_decode(json_encode($sm_names)) }}, datasets: [{ data: {{ str_replace('"','',json_encode($sm_totals))}},
and so it is displayed in javascript:
labels: ["John","Mercy ","Gary"], datasets: [{ data: [425000,470000,10000],
source share