From e04e156fac182e9d2a24c2c5786b4275ae48649c Mon Sep 17 00:00:00 2001 From: Caleb Bassi Date: Thu, 16 Aug 2018 17:48:07 -0700 Subject: [PATCH] Update example/ttop --- _example/ttop.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/_example/ttop.go b/_example/ttop.go index 09e4fdd..c858b35 100644 --- a/_example/ttop.go +++ b/_example/ttop.go @@ -19,7 +19,7 @@ import ( "strings" "github.com/gizak/termui" - "github.com/gizak/termui/_extra" + "github.com/gizak/termui/extra" ) const statFilePath = "/proc/stat" @@ -231,9 +231,9 @@ func (cte *CpuTabElems) Update(cs CpusStats) { p := int(val.user + val.nice + val.system) cte.GMap[key].Percent = p if key == "cpu" { - cte.LChart.Data = append(cte.LChart.Data, 0) - copy(cte.LChart.Data[1:], cte.LChart.Data[0:]) - cte.LChart.Data[0] = float64(p) + cte.LChart.Data["default"] = append(cte.LChart.Data["default"], 0) + copy(cte.LChart.Data["default"][1:], cte.LChart.Data["default"][0:]) + cte.LChart.Data["default"][0] = float64(p) } } }