chart

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 7 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"
)

Functions

This section is empty.

Types

type Chart

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

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

type ChartData added in v1.5.0

type ChartData struct {
	Label string     `json:"label"`
	Data  []DataItem `json:"data"`
}

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"`
	Formatter string  `json:"formatter"`
	Color     string  `json:"color"`
}

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 {
	Name   string `json:"name"`
	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"`
}

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