This commit is contained in:
Caleb Bassi 2018-04-09 09:55:10 -07:00
parent ca4febfc8b
commit 6b469e9f88
2 changed files with 3 additions and 3 deletions

View File

@ -169,7 +169,7 @@ func widgetColors() {
LineColor := make(map[string]ui.Color)
if cpu.Count <= 8 {
for i := 0; i < len(cpu.Data); i++ {
LineColor[fmt.Sprintf("CPU%d", i+1)] = ui.Color(colorscheme.CPULines[i])
LineColor[fmt.Sprintf("CPU%d", i)] = ui.Color(colorscheme.CPULines[i])
}
} else {
LineColor["Average"] = ui.Color(colorscheme.CPULines[0])

View File

@ -25,7 +25,7 @@ func NewCPU(interval time.Duration, zoom int) *CPU {
self.Zoom = zoom
if self.Count <= 8 {
for i := 0; i < self.Count; i++ {
key := "CPU" + strconv.Itoa(i+1)
key := "CPU" + strconv.Itoa(i)
self.Data[key] = []float64{0}
}
} else {
@ -48,7 +48,7 @@ func (self *CPU) update() {
if self.Count <= 8 {
percent, _ := psCPU.Percent(self.interval, true)
for i := 0; i < self.Count; i++ {
key := "CPU" + strconv.Itoa(i+1)
key := "CPU" + strconv.Itoa(i)
self.Data[key] = append(self.Data[key], percent[i])
}
} else {