Im kinda new to jquery.
I have a graph in jquery and the graph get the data statically.
and I want it dynamically
this is the static data.
var data = [
{ label: "New Request", data: 1.7, color: "#68BC31"},
{ label: "On-Going", data: 24.5, color: "#2091CF"},
{ label: "Deadlines", data: 8.2, color: "red"},
]
I have ajax that returns this value.
{"label":"active","data":"4", color: "#68BC31"}
this is my ajax.
jQuery.ajax({
type: "POST",
url: "dashboard/graph_data/",
success:function(response){
return response;
// the response returns this value
// {"label":"active","data":"4", color: "#68BC31"}
}
});
how do I replace or convert the static data to my ajax function.
thanks in advance