table

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: MIT Imports: 4 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aggregation

type Aggregation struct {
	Label string
	Type  AggregationType
}

Aggregation configures how to display an aggregate in the table.

type AggregationType

type AggregationType string

AggregationType represents an aggregation function used on values returned by the query.

const (
	// AVG aggregates results by computing the average.
	AVG AggregationType = "avg"

	// Count aggregates results by counting them.
	Count AggregationType = "count"

	// Current aggregates results by keeping only the current value.
	Current AggregationType = "current"

	// Min aggregates results by keeping only the smallest value.
	Min AggregationType = "min"

	// Max aggregates results by keeping only the largest value.
	Max AggregationType = "max"
)

type Option

type Option func(table *Table)

Option represents an option that can be used to configure a table panel.

func AsAnnotations

func AsAnnotations() Option

AsAnnotations displays the data as annotations.

func AsJSON

func AsJSON() Option

AsJSON displays the data as JSON.

func AsTable

func AsTable() Option

AsTable displays the data as a table.

func AsTimeSeriesAggregations

func AsTimeSeriesAggregations(aggregations []Aggregation) Option

AsTimeSeriesAggregations displays the data according to the given aggregation methods.

func DataSource

func DataSource(source string) Option

DataSource sets the data source to be used by the table.

func Description added in v0.13.2

func Description(content string) Option

Description annotates the current visualization with a human-readable description.

func Height

func Height(height string) Option

Height sets the height of the panel, in pixels. Example: "400px".

func HideColumn

func HideColumn(columnLabelPattern string) Option

HideColumn hides the column having a label matching the given pattern.

func Span

func Span(span float32) Option

Span sets the width of the panel, in grid units. Should be a positive number between 1 and 12. Example: 6.

func TimeSeriesToColumns

func TimeSeriesToColumns() Option

TimeSeriesToColumns displays the data in columns.

func TimeSeriesToRows

func TimeSeriesToRows() Option

TimeSeriesToRows displays the data in rows.

func Transparent added in v0.12.9

func Transparent() Option

Transparent makes the background transparent.

func WithGraphiteTarget added in v0.14.0

func WithGraphiteTarget(query string, options ...graphite.Option) Option

WithGraphiteTarget adds a Graphite target to the table.

func WithInfluxDBTarget added in v0.15.0

func WithInfluxDBTarget(query string, options ...influxdb.Option) Option

WithInfluxDBTarget adds an InfluxDB target to the table.

func WithPrometheusTarget

func WithPrometheusTarget(query string, options ...prometheus.Option) Option

WithPrometheusTarget adds a prometheus target to the table.

type Table

type Table struct {
	Builder *sdk.Panel
}

Table represents a table panel.

func New

func New(title string, options ...Option) *Table

New creates a new table panel.

Jump to

Keyboard shortcuts

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