Conversation
|
Same, I'm not sure about the option name but that's maybe because it looks like a workaround option? What if we provide a new alignment: 'start' // horizontal axis: 'left', vertical axis: 'top'
alignment: 'end' // horizontal axis: 'right', vertical axis: 'bottom'
alignment: 'center' // horizontal axis: 'center', vertical axis: 'center'
alignment: 'auto' // first tick: 'left' or 'top', last tick: 'right' or 'bottom' else 'center'By default it would be |
|
I do like the idea of 'alignment'. I will prototype that out and then also work on the auto-skip with rotation. We can just default to alignment: 'center' which matches the old behaviour then change the default to 'auto' in a major version release |
|
Sounds good, I thought that the current implementation was |
|
@simonbrunel I changed the option to alignment and got it working for both horizontal and vertical axes. I haven't updated the auto skip code yet to handle this better. |
|
Looks really good |
|
@simonbrunel I got the tests passing. I still need to figure out how to make the auto skipper work better with these new settings, but they should really help with the issues users have seen. |
…vertical implementation because it's easier to deal with as the label widths do not matter. The first and last tick are always shown. Any other label that overlaps the first and last ticks is not shown. It is also compared against the last label that was shown in the middle to see if it overlaps.
|
@simonbrunel @zachpanz88 @tannerlinsley @derekperkins I got started on improving the auto skipper. It now works for the vertical axes but I haven't re-enabled it for the horizontal axes. The following series of screenshots shows what it looks like during resizing. |
…ck use of the autoSkipPadding for vertical axes and added some rounding to improve the stability.
|
Looks great, not sure about the last screenshot which seems weird (I would expect 25 and 250 or less ticks). Some space between the tick label and grid line would be nice (~2px). We should really start to split these huge methods in small functions, |
|
Agreed about the function length. For the last image, only 25 and 250 go because of the new alignment on the first and last labels. |
|
The last pic is also a bit weird because I forced a step size of 25 to make sure that the auto skipper ran. |
|
I did some more work on this for the horizontal auto skip. It does not work well. I think before we can really do anything with this we need to brainstorm how this will work. @tannerlinsley @derekperkins @zachpanz88 @simonbrunel any ideas? |
Conflicts: src/core/core.scale.js test/scale.radialLinear.tests.js
|
@etimberg Hello I came from #3707. https://jsfiddle.net/KoyoSE/c7orw1ka/ In this case, Auto skipper may not be needed. (but not sure 😄 ) |
|
https://jsfiddle.net/KoyoSE/w25hjah1/ How about other methods instead of auto skipper like this sample? |
|
@KoyoSE other options instead of the autoskipper are definitely a possibility. I'm not sure what the implications of that are |
|
@etimberg https://jsfiddle.net/KoyoSE/hj4g8zgm/ Common settingmin: -42500, First charttype : 'linear', Second charttype: 'fineLinear', Plan (Proposal)Controlling the display of tick text, lines are displayed. Othersolution of issue #3707 |
|
@KoyoSE please open a PR with your changes. I'd love to see how they work and get the other @chartjs/maintainers thoughts on them |
|
@etimberg All right. Please wait a little. |
|
Closing as out of date |









Initial work on fixing issues like #2478
Adds a new tick option
consistentAlignmentthat if true sets the alignment of horizontal axis labels to be all the same. If false, the first tick uses left alignment and the last uses right alignment.@simonbrunel @zachpanz88 I'm not entirely sure about the name of this option. I think I still need to do some work to make the auto skip work better for these new cases. I also don't know if we should default this
trueorfalse@AlexDar this is the issue I mentioned to you.