mirror of
https://github.com/ratatui-org/ratatui
synced 2024-11-10 07:04:17 +00:00
fix(widgets): Prevent chart legend from rendering when no dataset has a name
This commit is contained in:
parent
05c96eaa28
commit
cfc90ab7f6
1 changed files with 1 additions and 0 deletions
|
@ -322,6 +322,7 @@ where
|
|||
let legend_height = self.datasets.len() as u16 + 2;
|
||||
if legend_width < layout.graph_area.width / 3
|
||||
&& legend_height < layout.graph_area.height / 3
|
||||
&& inner_width > 0
|
||||
{
|
||||
layout.legend_area = Some(Rect::new(
|
||||
layout.graph_area.right() - legend_width,
|
||||
|
|
Loading…
Reference in a new issue