sparkline

package
v0.0.0-...-a321ef9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2016 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Short   = 1
	Percent = 2
	Bytes   = 3
	Time    = 4
)

Variables

This section is empty.

Functions

This section is empty.

Types

type SparkLine

type SparkLine struct {
	SL   *ui.Sparkline `json:"-"`
	From string        `json:"from"`

	DataType   int          `json:"type"`
	Title      string       `json:"title"`
	TitleColor ui.Attribute `json:"titlecolor"`
	Where      string       `json:"where"`
	Height     int          `json:"height"`
	LineColor  ui.Attribute `json:"linecolor"`
	// contains filtered or unexported fields
}

SparkLine is a single stat drawn using the termui sparkline.

func (*SparkLine) SetData

func (s *SparkLine) SetData(time string, groupBy string)

SetData sets the data in the sparkline that will be drawn.

func (*SparkLine) SetTitle

func (s *SparkLine) SetTitle(time string)

SetTitle sets the title for the sparkline adding extar info like mean and max totals.

type SparkLines

type SparkLines struct {
	SL    *ui.Sparklines `json:"-"`
	Lines []*SparkLine   `json:"lines"`

	BorderLabel   string       `json:"borderlabel"`
	Border        bool         `json:"border"`
	BorderFg      ui.Attribute `json:"borderfg"`
	BorderBg      ui.Attribute `json:"borderbg"`
	BorderLeft    bool         `json:borderleft"`
	BorderRight   bool         `json:"borderright"`
	BorderTop     bool         `json:"bordertop"`
	BorderBottom  bool         `json:"borderbottom"`
	BorderLabelFg ui.Attribute `json:"borderlabelfg"`
	BorderLabelBg ui.Attribute `json:"borderlabelbg"`
	Display       bool         `json:"display"`
	Bg            ui.Attribute `json:"bg"`
	Width         int          `json:"width"`
	Height        int          `json:"height"`
	PaddingTop    int          `json:"paddingtop"`
	PaddingBottom int          `json:"paddingbottom"`
	PaddingLeft   int          `json:"paddingleft"`
	PaddingRight  int          `json:"paddingright"`
}

SparkLines is a collection of sparklines that can have extra ui attributes.

func NewSparkLines

func NewSparkLines(db DB.DBI, s *SparkLines) *SparkLines

NewSparkLines builds a new sparkline from a partial build sparkline which should come from parsing a json dashboard.

func (*SparkLines) Update

func (s *SparkLines) Update(time TS.TimeSelect)

Update will update all the data associated to the sparklines

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL