Optimizing Chart Plot of Data From MariaDB

Hello everyone.

I am plotting data queried from MariaDB into Xojo Web Chart and also in ChartJS via Web SDK ( as provided previously in this forum)
Has anybody tried to return plottable query ( perhaps in columns of X | Y values ) in JSON or string form that can be feed directly into the charts ( Xojo control or Xojo ChartJS Web SDK Control)?
This is to avoid having to iterate the rowset and transferring the data to array individually before passing to the charts which takes sometimes to execute.

TIA