Search code examples
javascriptjqueryjquery-pluginsjqplot

jqplot: "this.proxy.getTime is not a function" / date input parser?


I try to use jqplot for drawing an graph. So i modified this example in order to get an date based graph.

Currently my code is like this:

  var plot1 = $.jqplot('chartdiv', [[["2010-12-25.14:19:47",1],
                                     ["2010-11-25.14:19:47",2],
                                     ["2010-10-25.14:19:47",3]]], {
      title: 'mytitle',

      series: [{
          label: 'my label',
          neighborThreshold: -1
      }],
      axes: {
          xaxis: {
              renderer: $.jqplot.DateAxisRenderer,
            //  min:'August 1, 2010 16:00:00',
              tickInterval: '1 months',
              tickOptions:{formatString:'%Y-%m-%d.%H:%M:%S'}
          },
          yaxis: {
              tickOptions:{formatString:'$%.2f'}
          }
      },
      cursor:{
        show: true,
        zoom:true,
        showTooltip:false
      }
  });

But I get the following error:

this.proxy.getTime is not a function
(function(w){var l;w.fn.emptyForce=fun...))?([nAscboxXuidfegpEGP])/g})(jQuery);

It looks like, the script have problems by parsing the date format. But why?

thank you, for any kind of help.

//Update.. ups, I found the reason very quickly after writing this post (and after 1 day of try-and-error" ;-) ) So the reason I found generates a new question: is there any jqplot option, to define how to parse the input date format?


Solution

  • ...sorry, after reading the documentation the 3rd time, I found the error: The date input format is wrong. I though, that tickOptions:{formatString:'%Y-%m-%d.%H:%M:%S'} will define "how to parse the input data". But it is only relevant for displaying the data, not for parsing the input string.

    But on this "formatString" you can guess, how jqPlot will parse the input date. So i had to change the input format to something like that: 2011-09-18 02:00:00

    Byt the way: is there any jqplot option, to define how to parse the input date format?