Question about flattening the monthly schedule

I am trying to create a monthly chart using the Flot library. The alignment with the center of the month is completely wrong with the x-axis. I created a jsfiddle to show the problem.

Intuitive when provided

bars: {
    show: true,
    fillColor: '#4682b4',
    barWidth: 15 * 24 * 60 * 60 * 1000,
    align: 'center'
},

      

I suppose the bar should coincide with the tick in the center, but it is not! The result I am expecting is the following:

enter image description here

Thank you so much!

+3


source to share


2 answers


Instead of only showing the month, include% d in the time format and you can see what happens. The fleet creates space for centered rods by subtracting half the rod width from the min axis. So the pivot is centered, but the x-axis ticks are not what you expect.

I'm researching what we can do about it; at the same time, you can either set an explicit low (which will either cut off the first bar or add unwanted white space to the left of it) or explicitly provide an array of ticks.



You can also try 0.7 instead of master, as that probably doesn't show this problem.

I'll update this answer when I'm done looking at the code.

+2


source


I have a similar problem. See Panel "nov". It was removed in October.



The solution is to add 1 hour to the timestamp 2013-10-01 + (3600 * 1000) (3600 s * 1000 milliseconds) Then the timeout starts at the correct place in the first month.

0


source







All Articles