chart(bar): Fix the label is not centered (#1448)
This commit is contained in:
parent
e005bd0f46
commit
0e2397cf15
1 changed files with 3 additions and 1 deletions
|
|
@ -154,7 +154,9 @@ where
|
|||
|
||||
if let Some(label) = self.label.as_ref() {
|
||||
let label = label.clone();
|
||||
bar = bar.label(move |d, p| vec![Text::new(label(d), p, label_color)]);
|
||||
bar = bar.label(move |d, p| {
|
||||
vec![Text::new(label(d), p, label_color).align(TextAlign::Center)]
|
||||
});
|
||||
}
|
||||
|
||||
bar.paint(&bounds, window, cx);
|
||||
|
|
|
|||
Loading…
Reference in a new issue