summaryrefslogtreecommitdiffstats
path: root/termui/gauge.go
blob: db9a9c03bba21ab732960625dd62eae29e12f2e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package termui

import (
	. "github.com/gizak/termui/v3"
	gizak "github.com/gizak/termui/v3/widgets"
)

// LineGraph implements a line graph of data points.
type Gauge struct {
	*gizak.Gauge
}

func NewGauge() *Gauge {
	return &Gauge{
		Gauge: gizak.NewGauge(),
	}
}

func (self *Gauge) Draw(buf *Buffer) {
	self.Gauge.Draw(buf)
	self.Gauge.SetRect(self.Min.X, self.Min.Y, self.Inner.Dx(), self.Inner.Dy())
}