javascript - jquery flot pointing on wrong place -


i have gone through alot of questions through stackoverflow none me. trying generate graph through jquery flot legend placed on wrong place.

here's screenshot of graph. data thursday displaying near friday. flot

here's javascript code

  var plot = $.plot("#chart_widget",                 [                     {                         data: issued,                         label: "issued"                     },                     {                         data: released,                         label: "released"                     },                 ],                 $.extend(true, {}, plugins.getflotdefaults(), {                     series: {                         lines: {                             fill: false,                             linewidth: 1.5                         },                         points: {                             show: true,                             radius: 4,                             linewidth: 1.1                         },                         grow: {active: true, growings: [{stepmode: "maximum"}]}                     },                     grid: {                         hoverable: true,                         clickable: true                     },                     xaxis: {                         mode: "time",                         minticksize: [1, "day"],                         daynames: ["sun", "mon", "tue", "wed", "thu", "fri", "sat"],                         timeformat: "%a",                         ticklength: 0                     },                     tooltip: true,                     tooltipopts: {                         content: '%s: $%y'                     }                 })                 ); 

here's screenshot of data through ajax request , assign above variables.

enter image description here

here's plunker http://plnkr.co/edit/aysgpk9eq84l55t5rogq?p=preview

the datapoint tooltip in image on thursday, @ 2 pm:

(new date(1437660070000)).toutcstring() "thu, 23 jul 2015 14:01:10 gmt" 

so nearer friday tick on axis thursday tick (the ticks @ midnight).

if day important graph can change timestamps @ midnight , align ticks on axis. do this, can use code this:

for (var = 0; < issued.length; i++) {     issued[i][0] = issued[i][0] - (issued[i][0] % 86400000); } 

see updated plunker.


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -