Problem passing json into jquery graph(flot)

Posted by Adam McMahon on Stack Overflow See other posts from Stack Overflow or by Adam McMahon
Published on 2010-04-27T01:51:22Z Indexed on 2010/04/27 1:53 UTC
Read the original article Hit count: 567

Filed under:
|
|

I trying to retrieve some json to pass into a flot graph. I know that json is right because I hard coded it to check, but I'm pretty sure that I'm not passing right because It's not showing up. Here's the javascript:

var total = $.ajax({
  type: "POST",
  async: false,
  url: "../api/?key=xxx&api=report&crud=return_months&format=json"
}).responseText;
//var total = $.evalJSON(total);
var plot = $.plot($("#placeholder"),total);

here's the json:

[ { data: [[1,12], [2,43], [3,10], [4,17], ], label: "E-File"}, { data: [[1,25], [2,35], [3,3], [4,5], ], label: "Bank Products" }, { data: [[1,41], [2,87], [3,30], [4,29], ], label: "All Returns" } ], {series: {lines: { show: true },points: { show: true }}, grid: { hoverable: true, clickable: true }, yaxis: { min: 0, max: 100 }, xaxis: { ticks: [[1,"January"],[2,"February"],[3,"March"],[4,"April"],[5,"May"],[6,"June"],[7,"July"],[8,"August"],[9,"September"],[10,"October"],[11,"November"],[12,"December"]] }}

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JSON