title: Pass Json Object from Play! framework to HighCharts JS
body: <p><br/>
  <a href="http://www.playframework.com/documentation/2.1.x/JavaTodoList" rel="nofollow noreferrer">http://www.playframework.com/documentation/2.1.x/JavaTodoList</a></p>
  
  <p>Using the above tutorial as a reference, I have created an application which sends data from the model to view via the Application controller.
  I have managed to display the model(Tasks) as a high chart. The code is here.</p>
  
  <pre><code>public static Result format(){      
      return ok(views.html.frmt.render("Visualize it",Task.all()));
  }
  </code></pre>
  
  <p>This goes to this view page.
  <a href="http://ideone.com/ycz9ko" rel="nofollow noreferrer">http://ideone.com/ycz9ko</a></p>
  
  <p>Currently, I use scala templating inside the javascript code itself. Refer to lines 9-14 and lines 20-24.This unelegant style of doing things is not really optimal. </p>
  
  <p>I want to be able to accomplish the above using Json instead.</p>
  
  <pre><code>public static Result jsonIt(){
      List&lt;Task&gt; tasks = Task.all();
      return ok(Json.toJson(tasks));
  }    
  </code></pre>
  
  <p>My Qns are how to send the JSON objects to a view template. 
  And how to parse it into a Highcharts format. Is there some standard procedure to do this ? Or else I have to write my own method to do this ?<br/>
  It'll great if someone can show me a code snippet. Also I would prefer a post not using Ajax. I would just want to know how to do this first. </p>
  
  <p>I also found this stackoverflow post useful.<a href="https://stackoverflow.com/questions/10499431/how-to-parse-json-into-highcharts">how to parse json into highcharts</a>. However, it didnt answer the part about converting from Play format to Highcharts format.</p>
  
  <p>Thanks in advance</p>