JQuery Flot + getJson problem
Hello everyone,
I'm a new to jquery, and working on a tutorial and trying to get a graph using jquery flot, but i'm getting a problem and i need some help...
here is my code in the home controller
public ActionResult Example()
{
string s = "[[[2003,10882],[2002,10383],[2001,10020], [2000, 9213]]," +
"[[2003, 599],[2002, 510],[2001, 479],[2000, 457]]]";
return Json(s, JsonRequestBehavior.AllowGet);
}
where i'm returning a json to the index page where i wrote the following javascript
$(function () {
$.getJSON("../../Home/Example", function (data) {
// alert(' ' + data + ' );
var plotarea = $("#plot_area");
$.plot(plotarea, data);
});
});
the problem is that i'm getting an empty graph with no data, although when alerting (as the commented line above) i get the data that is needed!
how do i solve this, and why am i getting the empty graph?
thanx a million in advance,
Lina