I am writing a script that downloads stock data and graphs the prices using libchart charting library. After downloading data to array $prices, I use the following line to add a new data point to my chart:
$serie1->addPoint(new Point($prices[$i]['date'], $prices[$i]['price']);
$prices contains both date and price keys. However, this throws off illegal string offset error for both keys. I have checked with isset, both variables contain values. I have also tried typecasting, date with (string) and price with (float), but these threw off new errors.
What could be causing the illegal string offset error? Is there a way to silence it?