Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

andylord565's avatar

chartjs lists

I am getting this odd data from using the code below anyone know how to stop this?

var data = {
    labels: [{"date":"2016-02-24 00:00:00","timezone_type":3,"timezone":"UTC"}]
    ],
$allsold =sales::where('status', '=', 'sold')->get();
->with('dates', $allsold->lists('created_at'));
0 likes
3 replies
willvincent's avatar

Why is the data in your labels array urlencoded?

Shouldn't that be:

var data = {
    labels: [
      {
        "date":"2016-02-24 00:00:00",
        "timezone_type":3,
        "timezone":"UTC"
      }
    ]
],

Please or to participate in this conversation.