New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ticks for bar charts of type time are not centered #3682
Comments
@CharlieEtienne check this issue #3589 and see if that can be the cause of your error. |
@geo-developer Thanks, but I don't think so, check the JSFiddle, there is no min or max option. It seems to be specific to time type. |
I have edited my JSFiddle, maybe it's clearer. |
@CharlieEtienne yeah i just asked cause it could be related, lately i've seen some issues with the bar and time so i gave it a try. |
@CharlieEtienne yeah i saw your fiddle but tried to give it a shot anyway, could it be something related to that issue. Your fiddle was fine mate. |
@geo-developer Thank you ! Could you help me to do that ? My level in JS is way too low... |
@CharlieEtienne yeah i can but only later in the day, right now i can't sorry mate. |
@geo-developer sounds perfect for me ! |
I believe this is because the |
@CharlieEtienne this is the best i can help you, but its just a hack https://jsfiddle.net/lenyy/ard8nbd2/ |
@lenyy Thank you, but the only difference I see is that bars are thinner... We still can't see sunday bar, and ticks are still not centered... |
@CharlieEtienne the bars being thinner you can change, but they are centered between the days, i thought you wanted that. Check the above fiddle to se the sunday bar. Where do you want the bars centered? Rigth now they are centered between days, but if you want the bar center to fall inside the monday label you need to pass one more more day to the initial label and one more day to the last, or you could just set the min and max values of the ticks. |
@geo-developer ah, perfect, I have the sunday bar. :-) What I'd like to get is the same as the chart below (with strings) : with labels between the grid lines, aligned with bars. (Sorry, I'm french, I don't know if I speak properly ;-) ) |
@CharlieEtienne check my fiddle https://jsfiddle.net/lenyy/ard8nbd2/ . This is the best hack i can give you right now |
Thanks to all of you. I think I will try an other way and first convert my dates with php, because it doesn't fit to my needs. Could you take 5 minutes again to help me with this new approach ? I want to display in Tooltip the full date, I think I'm close to the solution but I can't find a way to get the right indice in tooltip title. (at line 25) It should be an easy one for you. Thanks again |
@geo-developer, @lenyy, could someone help me with that ? |
@CharlieEtienne just change line 25 to data.labels[tooltipItems[0].index]; |
I think there are three issues here.
https://jsfiddle.net/nagix/9emorgws/ (using category scale of 2.6.0). |
Hello,
I'm not sure if it's a bug or the normal behaviour, but when you give type 'time' to xAxes, the ticks aren't centered anymore and move to the center of gridlines instead of center of bars.
Is there a way to avoid that ?
See JSFiddle : https://jsfiddle.net/CharlieWebNancy/apawqy6n/
Thank you very much.
Environment
The text was updated successfully, but these errors were encountered: