mirror of https://github.com/cjbassi/gotop.git
Fixed bug where linegraphs would overwrite the key
This commit is contained in:
parent
44a6eebae9
commit
c6ae8a46fb
|
@ -46,7 +46,7 @@ func (lc *LineGraph) Buffer() *Buffer {
|
|||
}
|
||||
sort.Strings(seriesList)
|
||||
|
||||
for j, seriesName := range seriesList {
|
||||
for _, seriesName := range seriesList {
|
||||
seriesData := lc.Data[seriesName]
|
||||
seriesLineColor, ok := lc.LineColor[seriesName]
|
||||
if !ok {
|
||||
|
@ -87,6 +87,14 @@ func (lc *LineGraph) Buffer() *Buffer {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for j, seriesName := range seriesList {
|
||||
seriesData := lc.Data[seriesName]
|
||||
seriesLineColor, ok := lc.LineColor[seriesName]
|
||||
if !ok {
|
||||
seriesLineColor = lc.DefaultLineColor
|
||||
}
|
||||
|
||||
// Render key ontop, but let braille be drawn between words
|
||||
str := fmt.Sprintf("%s %3.0f%%", seriesName, seriesData[len(seriesData)-1])
|
||||
|
|
Loading…
Reference in New Issue