Documentation
¶
Index ¶
- type BarAlignment
- type GradientType
- type LegendOption
- type LineInterpolationMode
- type Option
- func Alert(name string, opts ...alert.Option) Option
- func Axis(options ...axis.Option) Option
- func Bars(alignment BarAlignment) Option
- func DataSource(source string) Option
- func Description(content string) Option
- func FillOpacity(value int) Option
- func GradientMode(mode GradientType) Option
- func Height(height string) Option
- func Legend(opts ...LegendOption) Option
- func LineWidth(value int) Option
- func Lines(mode LineInterpolationMode) Option
- func PointSize(value int) Option
- func Points() Option
- func Repeat(repeat string) Option
- func Span(span float32) Option
- func Tooltip(mode TooltipMode) Option
- func Transparent() Option
- func WithGraphiteTarget(query string, options ...graphite.Option) Option
- func WithInfluxDBTarget(query string, options ...influxdb.Option) Option
- func WithPrometheusTarget(query string, options ...prometheus.Option) Option
- func WithStackdriverTarget(target *stackdriver.Stackdriver) Option
- type TimeSeries
- type TooltipMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BarAlignment ¶
type BarAlignment int
BarAlignment defines how Grafana aligns bars.
const ( // The bar is drawn around the point. The point is placed in the center of the bar. AlignCenter BarAlignment = 0 // The bar is drawn before the point. The point is placed on the trailing corner of the bar. AlignBefore BarAlignment = -1 // The bar is drawn after the point. The point is placed on the leading corner of the bar. AlignAfter BarAlignment = 1 )
type GradientType ¶
type GradientType string
GradientType defines the mode of the gradient fill.
const ( // No gradient fill. NoGradient GradientType = "none" // Transparency of the gradient is calculated based on the values on the y-axis. // Opacity of the fill is increasing with the values on the Y-axis. Opacity GradientType = "opacity" // Gradient color is generated based on the hue of the line color. Hue GradientType = "hue" // In this mode the whole bar will use a color gradient defined by the color scheme. Scheme GradientType = "scheme" )
type LegendOption ¶
type LegendOption uint16
LegendOption allows to configure a legend.
const ( // Hide keeps the legend from being displayed. Hide LegendOption = iota // AsTable displays the legend as a table. AsTable // AsList displays the legend as a list. AsList // Bottom displays the legend below the graph. Bottom // ToTheRight displays the legend on the right side of the graph. ToTheRight // Min displays the smallest value of the series. Min // Max displays the largest value of the series. Max // Avg displays the average of the series. Avg // First displays the first value of the series. First // FirstNonNull displays the first non-null value of the series. FirstNonNull // Last displays the last value of the series. Last // LastNonNull displays the last non-null value of the series. LastNonNull // Total displays the sum of values in the series. Total // Count displays the number of value in the series. Count // Range displays the difference between the minimum and maximum values. Range )
type LineInterpolationMode ¶
type LineInterpolationMode string
LineInterpolationMode defines how Grafana interpolates series lines when drawn as lines.
const ( // Points are joined by straight lines. Linear LineInterpolationMode = "linear" // Points are joined by curved lines resulting in smooth transitions between points. Smooth LineInterpolationMode = "smooth" // The line is displayed as steps between points. Points are rendered at the end of the step. StepBefore LineInterpolationMode = "stepBefore" // Line is displayed as steps between points. Points are rendered at the beginning of the step. StepAfter LineInterpolationMode = "stepAfter" )
type Option ¶
type Option func(timeseries *TimeSeries)
Option represents an option that can be used to configure a graph panel.
func Bars ¶
func Bars(alignment BarAlignment) Option
Bars displays the series as bars, with a given alignment strategy.
func DataSource ¶
DataSource sets the data source to be used by the graph.
func Description ¶
Description annotates the current visualization with a human-readable description.
func FillOpacity ¶
FillOpacity defines the opacity level of the series. The lower the value, the more transparent.
func GradientMode ¶
func GradientMode(mode GradientType) Option
GradientMode sets the mode of the gradient fill.
func Legend ¶
func Legend(opts ...LegendOption) Option
Legend defines what should be shown in the legend.
func LineWidth ¶
LineWidth defines the width of the line for a series (default 1, max 10, 0 is none).
func Lines ¶
func Lines(mode LineInterpolationMode) Option
Lines displays the series as lines, with a given interpolation strategy.
func Span ¶
Span sets the width of the panel, in grid units. Should be a positive number between 1 and 12. Example: 6.
func WithGraphiteTarget ¶
WithGraphiteTarget adds a Graphite target to the table.
func WithInfluxDBTarget ¶
WithInfluxDBTarget adds an InfluxDB target to the graph.
func WithPrometheusTarget ¶
func WithPrometheusTarget(query string, options ...prometheus.Option) Option
WithPrometheusTarget adds a prometheus query to the graph.
func WithStackdriverTarget ¶
func WithStackdriverTarget(target *stackdriver.Stackdriver) Option
WithStackdriverTarget adds a stackdriver query to the graph.
type TimeSeries ¶
TimeSeries represents a time series panel.
func New ¶
func New(title string, options ...Option) *TimeSeries
New creates a new time series panel.
type TooltipMode ¶
type TooltipMode string
TooltipMode configures which series will be displayed in the tooltip.
const ( // SingleSeries will only display the hovered series. SingleSeries TooltipMode = "single" // AllSeries will display all series. AllSeries TooltipMode = "multi" // NoSeries will hide the tooltip completely. NoSeries TooltipMode = "none" )