I have a method in controller class which returns JSON data:
public ActionResult ChartDataJSON()
{
Chart chart = new Chart();
DataSet ds = dbLayer.Ge
As @user1254053 I also had trouble implementing @Fresh's solution. I was trying to write the js code in my ChartDataJSON view, I mean in the view from the ChartDataJSON() method and I just got plain text objects printed out when running my view.
Then I tried to write my view code in another view, the index view for example or any other view that just has a return(View)
statement and worked out.
I hope this may help other people and I wish I'm not too late.