jquery - Why is jQplot Coming Up Blank? -


i'm new jquery , jqplot.

i have web application needs plot array of points onto graph. graph showing blank , problem don't know it's running trouble...

the body of code responsible executing plot simple, see below:

function graphdata(pricedata){ var options =  {     series:[{showmarker:false}],     axes:     {         xaxis:         {             renderer:$.jqplot.dateaxisrenderer,             tickoptions:{ formatstring:'%h:%m:%s' },             tickinterval:'15 second'         },         yaxis:         {             numberticks: 6,                          tickoptions:{formatstring:'%.2f'}                }     } } var plot = $.jqplot('chartcontainer',[[data]], options); 

}

and i'm seeing blank canvas. clear went , checked data array made of, , sure enough it's 2d array each nested array looks [x-coord, y-coord], here's sample

["08:11:15", "29.21"] ["08:12:35", "29.21"] ["08:13:44", "29.25"] ["08:14:58", "29.24"] ["08:16:12", "29.25"] ["08:17:22", "29.21"]

to knowledge, type of array (that contains arrays of coordinate pairs) recomended default jqplot, no? documentation i've looked @ seems me input data perfect plot. can't see messing up.

if helps, array comes csv file, when csv read triggers callback plotting function above ^^^ csv fetch function shown below:

    $(document).ready(function(){     $.jqplot.config.enableplugins = true;     $.ajax({         url: "data/sample.csv",         async: true,         success: function (csvd) {             data = $.csv.toarrays(csvd);         },         datatype: "text",         complete: function (data) { graphdata(data); }      });  }); 

turns out dates in string format when need in date (object format)


Comments

Popular posts from this blog

How to prevent logback from emitting repeated "Empty watch file list. Disabling" messages -

iOS: Performance of reloading UIImage(name:...) -

c# SetCompatibleTextRenderingDefault must be called before the first -