axis

package
v0.22.1 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2023 License: MIT Imports: 3 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Axis

type Axis struct {
	// contains filtered or unexported fields
}

Axis represents a visualization axis.

func New

func New(fieldConfig *sdk.FieldConfig, options ...Option) (*Axis, error)

New creates a new Axis configuration.

type Option

type Option func(axis *Axis) error

Option represents an option that can be used to configure an axis.

func Decimals

func Decimals(decimals int) Option

Decimals sets how many decimal points should be displayed.

func Label

func Label(label string) Option

Label sets a Y-axis text label.

func Max

func Max(value float64) Option

Max defines a hard maximum value for the axis.

func Min

func Min(value float64) Option

Min defines a hard minimum value for the axis.

func Placement

func Placement(placement PlacementMode) Option

Placement defines how the axis should be placed in the panel.

func Scale

func Scale(mode ScaleMode) Option

Scale sets the scale to use for the Y-axis values..

func SoftMax

func SoftMax(value int) Option

SoftMax defines a soft maximum value for the axis.

func SoftMin

func SoftMin(value int) Option

SoftMin defines a soft minimum value for the axis.

func Unit

func Unit(unit string) Option

Unit sets the unit of the data displayed in this series.

type PlacementMode

type PlacementMode string

PlacementMode represents the axis display placement mode.

const (
	Hidden PlacementMode = "hidden"
	Auto   PlacementMode = "auto"
	Left   PlacementMode = "left"
	Right  PlacementMode = "right"
)

type ScaleMode

type ScaleMode uint8

ScaleMode represents the axis scale distribution.

const (
	Linear ScaleMode = iota
	Log2
	Log10
)

Jump to

Keyboard shortcuts

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