I get google chart data from PHP function in json encoded format which I am passing to "arrayToDataTable" function. I am using $.ajax function. When I pass the following data to the "arrayToDataTable" function
var obj = $.parseJSON('[
["goals", "goal", {
role: 'style'
}, {
role: 'tooltip'
}],
[54, 0.5, "#0000cf", "54%"],
[100, 1.5, "#0000cf", "100%"],
[97, 2.5, "#0000cf", "97%"],
[87, 2.5, "#0000cf", "87%"]
]')
var data = google.visualization.arrayToDataTable(obj);
It is generating a following error.
SyntaxError: JSON.parse: expected property name or '}' at line 1 column 19 of the JSON data
If data is sent without "style" and "tooltip" columns it is generating a graph as expected.
I am following this post: Google Chart - uncaught error: not an array