-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
[FEATURE] Title alignment Left or Right options #3706
Comments
@SmashedBird. I am working on this, I will PR soon. When PR comes in: We should be able to offer |
@Jareechang in the interests of consistency, is it possible to also support alignment for vertical legends (top, bottom, center). If so, is it possible to use a single enum of values that are direction agnostic? |
support alignment for vertical legends single enum of values |
Yup, that's what I meant. For the top and bottom positions the text could be left, center, or right but for the left and right positions the options would be top, center, bottom. For the enum, I was thinking 3 values
|
ah I see, thanks for expanding. That makes sense. I'll need to come up with a strategy for checking title Position with the enums. |
hey @etimberg, looking over the enum values, I am having a difficult time implementing it with those values. the position alignment is based on unique X and Y value for vertical or horizontal positions. Alternatives1. Add more enum values
.... positions: start_horizontal, start_vertical, end_vertical, end_horizontal 2. Nested K-V pairs var positionToAlignment = {
vertical: {
top: {
x: ...,
y: ...
},
bottom: {
...
},
center: {
....
}
},
horizontal: {
left: {
...
},
right: {
...
},
center: {
...
}
},
}; Let me know what you think. |
@Jareechang in your proposal, what would happen if the user set |
well, in the case, we would most likely need to enforce / validate that in our "pattern matcher" when getting the enum values. Steps:
rough Example: match ->
isHorizontal ?
isValid ?
returnValueBasedOnAlignment
isVertical ?
isValid ?
returnValueBasedOnAlignment input: { titlePosition: 'top / bottom', alignment: 'Left' }
-> START_HORIZONTAL
input: { titlePosition: 'left / right', alignment: 'Left' }
-> CENTER (default to center because invalid user input) |
@Jareechang if we need a method that returns These options should satisfy @SmashedBird and @etimberg requests (consistent with this proposal):
|
Awesome. Thank you for the good work @simonbrunel |
quick question @simonbrunel or @etimberg. I am trying to implement this solution but I am blocked by some implementation. Both of these use the Align Right (works fine): is |
hello. I still can't find this feature in latest documentation. |
Yes this would be a very nice feature. |
Although this feature is called "Title alignment options" please implement the same for the Legend. |
Can a more flexible text positioning be added, I have a requirement for a certain format to be replicated and it would be useful to able to attach several text elements at several positions with multiline and size/font/colour formatting. Similar to my crudely drawn example. |
Any updates on this? |
I am also interested in text-alignment of both the legend items as well as the chart title. Does anyone know whether progress has been made on any of these two possible configurations? |
+1 |
2 similar comments
+1 |
+1 |
+1 |
1 similar comment
+1 |
Hi @Jareechang |
+1 |
Any update on this ? |
+1 |
2 similar comments
+1 |
+1 |
Hey Everyone, unfortunately, sorry I do not have much time. Also, I do not use the library much anymore so have not been able to keep up with the developments. |
I'm also interested in this feature +1 |
me too |
Hope finish soon :) |
+1 Going to have to hide the legend and make an HTML replacement because of this |
+1 |
I believe this was implemented for v3: #6908 |
In v2 the title options for "position" are top,right,left,bottom.
It would be nice to have an option for textAlign (left, center,right).
Currently, by default textAlign is center.
For exemple, I would like to have my text at the top [position:'top'] aligned to the left [textAlign:'left'] instead of center.
The text was updated successfully, but these errors were encountered: