diff --git a/termui/linegraph.go b/termui/linegraph.go index 7a88566..41a2dea 100644 --- a/termui/linegraph.go +++ b/termui/linegraph.go @@ -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])