Open gsauthof opened 4 years ago
I had the same issue and got it working by subtracting the height of the runes. Unfortunately it seems this project is no longer maintained so here's what I changed locally:
if labelsRight {
for i, group := range table.Columns {
- c.GetBuffer().WriteRight(c.GetBuffer().Height-i, paddingX+1+chartWidth/c.RuneSize().Width, []rune(Fi(i)))
- c.GetBuffer().WriteRight(c.GetBuffer().Height-i, paddingX+4+chartWidth/c.RuneSize().Width, []rune(group))
+ c.GetBuffer().WriteRight(c.GetBuffer().Height-i-c.RuneSize().Height, paddingX+1+chartWidth/c.RuneSize().Width, []rune(Fi(i)))
+ c.GetBuffer().WriteRight(c.GetBuffer().Height-i-c.RuneSize().Height, paddingX+4+chartWidth/c.RuneSize().Width, []rune(group))
}
}
Before
After
Example:
When my terminal is wide enough then the 15 intervals are correctly included below each bar.
But when the terminal to small for inline display, the then displayed legend just includes 14 intervals, i.e. the interval for the zeroth bar is missing.
That means the legend looks like this:
The inline display: