I am trying to generate a chart using Google Charts API, but I can\'t seem to get the data in the required format.
serializeJSON(data)
in coldfusion gives m
This is basically what you need. Just plug in your query data.
<cfset chartsData = structNew()>
<cfset chartsData["cols"] = arrayNew(1)>
<!--- use a query loop to copy query data to this struct --->
<cfloop query="UserDetailsResult">
<cfset chartsRow = structNew()>
<cfset chartsRow["id"] = "">
<cfset chartsRow["label"] = "SignIn Method">
<cfset chartsRow["pattern"] = "">
<cfset chartsRow["type"] = "string">
<cfset arrayAppend(chartsData["cols"], chartsRow)>
</cfloop>
<cfset chartsDataJSON = serializeJSON(chartsData)>