chart

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Allocated       = "Allocated"
	Free_Allocate   = "Free-Allocate"
	Cannot_Allocate = "Cannot-Allocate"

	Memory = "memory"
	CPU    = "cpu"
	Pods   = "pods"

	DefaultFormat = "{d}%\n"
)

Functions

func GetScaleValue

func GetScaleValue(quantity1 *resource.Quantity, quantity2 *resource.Quantity, quantity3 *resource.Quantity) (string, string, string)

Types

type Chart

type Chart struct {
	base.DefaultProvider
	SDK    *cptype.SDK
	Ctx    context.Context
	CtxBdl *bundle.Bundle
	Type   string `json:"type"`
	Props  Props  `json:"props"`
}

func (*Chart) ChartRender

func (cht *Chart) ChartRender(ctx context.Context, c *cptype.Component, scenario cptype.Scenario, event cptype.ComponentEvent, gs *cptype.GlobalStateData, ResourceType string) error

func (*Chart) GetProps

func (cht *Chart) GetProps(name string) Props

type ChartInterface

type ChartInterface interface {
	ChartRender(ctx context.Context, c *cptype.Component, scenario cptype.Scenario, event cptype.ComponentEvent, gs *cptype.GlobalStateData) error
}

type DataItem

type DataItem struct {
	Value float64 `json:"value"`
	Name  string  `json:"name"`
	Label Label   `json:"label"`
}

type Grid

type Grid struct {
	Bottom       int  `json:"bottom"`
	Top          int  `json:"top"`
	ContainLabel bool `json:"containLabel"`
}

type Label

type Label struct {
	Formatter string `json:"formatter"`
}

type Legend

type Legend struct {
	Data   []string `json:"data"`
	Bottom string   `json:"bottom"`
}

type Option

type Option struct {
	Color  []string `json:"color"`
	Legend Legend   `json:"legend"`
	Grid   Grid     `json:"grid"`
	Series []Serie  `json:"series"`
}

type Props

type Props struct {
	Option Option `json:"option"`
	Title  string `json:"title"`
	Style  Style  `json:"style"`
}

type Serie

type Serie struct {
	Type   string     `json:"type"`
	Radius string     `json:"radius"`
	Data   []DataItem `json:"data"`
}

type Style

type Style struct {
	Flex int `json:"flex"`
}

type TextStyle

type TextStyle struct {
	FrontSize int `json:"frontSize"`
}

type Title

type Title struct {
	Text      string    `json:"text"`
	TextStyle TextStyle `json:"textStyle"`
}

Jump to

Keyboard shortcuts

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