sthornton1978
05/12/2022, 8:17 AMHas anyone used google.visualization.LineChart recently?
I am looking to have a query result returned by a CFC, and I can't quite grasp how to pass the result ( as JSON? ) to the google API.
I was hoping not to re-invent the wheel.
What is causing me concern the most, is setting the data types of the columns. An example that better explains it then me ( although php) . The ajax call would call a method of a CFC.
<https://developers.google.com/chart/interactive/docs/php_example>
drewnathanson
05/12/2022, 11:51 AMsthornton1978
05/12/2022, 11:03 PMsthornton1978
05/12/2022, 11:06 PMsthornton1978
05/12/2022, 11:07 PMScott Steinbeck
05/12/2022, 11:42 PM[
['Employee Name', 'Salary'],
['Mike', {v:22500, f:'22,500'}], // Format as "22,500".
['Bob', 35000],
['Alice', 44000],
['Frank', 27000],
['Floyd', 92000],
['Fritz', 18500]
],
yours currently is more like
{ "COLUMNS":
['Employee Name', 'Salary'],
"DATA":
['Mike', {v:22500, f:'22,500'}], // Format as "22,500".
['Bob', 35000],
['Alice', 44000],
['Frank', 27000],
['Floyd', 92000],
['Fritz', 18500]
},
Scott Steinbeck
05/12/2022, 11:44 PMvar qry = deserializeJSON(serializeJSON(dcr));
var returnData = qry.data;
arrayPrepend(returnData,qry.columns);
return returnData;
Scott Steinbeck
05/12/2022, 11:49 PM