Hello everyone,
I'm a newbeginner and need some help on a tutorial i'm working on...
I'm trying to draw a simple graph using jQuery Flot + ASP.Net mvc
so here is the method i added in HomeController:
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);
}
and here is the javascript code i wrote in the index.aspx page
$(function () {
$.getJSON("../../Home/Example", function (data) {
alert('json: ' + data + ' ...');
var plotarea = $("#plot_area");
$.plot(plotarea, data);
});
});
so when alerting i get the data that i'm sending from the controller, but i get only an empty graph with no data!
what am i doing wrong???
thanks a million for your help in advance...
Lina