hcapi

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ChartTypeLine      = "line"
	ChartTypeBar       = "bar"
	ChartTypeHistogram = "histogram"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AxisOptions

type AxisOptions struct {
	Title string `json:"title,omitempty"`
}

type ChartItem

type ChartItem struct {
	Type     string       `json:"type"`
	Options  ChartOptions `json:"options"`
	Labels   []string     `json:"labels,omitempty"`
	Datasets []*DataItem  `json:"datasets,omitempty"`
}

func (*ChartItem) Valid

func (it *ChartItem) Valid() error

type ChartOptions

type ChartOptions struct {
	Title  string      `json:"title,omitempty"`
	Width  float64     `json:"width,omitempty"`
	Height float64     `json:"height,omitempty"`
	X      AxisOptions `json:"x,omitempty"`
	Y      AxisOptions `json:"y,omitempty"`
}

func (*ChartOptions) HeightLength

func (it *ChartOptions) HeightLength() float64

func (*ChartOptions) WidthLength

func (it *ChartOptions) WidthLength() float64

type ChartRenderOptions

type ChartRenderOptions struct {
	Name      string `json:"name"`
	SvgEnable bool   `json:"svg_enable"`
	PngEnable bool   `json:"png_enable"`
}

type DataItem

type DataItem struct {
	Name   string       `json:"name,omitempty"`
	Attrs  []string     `json:"attrs,omitempty"`
	Points []*DataPoint `json:"points,omitempty"`
}

func NewDataItem

func NewDataItem(name string) *DataItem

func (*DataItem) AttrSet

func (it *DataItem) AttrSet(v string)

func (*DataItem) Point

func (it *DataItem) Point(x float64) *DataPoint

func (*DataItem) PointSet

func (it *DataItem) PointSet(x, y float64)

func (*DataItem) PointTs

func (it *DataItem) PointTs() []string

func (*DataItem) PointXs

func (it *DataItem) PointXs() []float64

func (*DataItem) PointYs

func (it *DataItem) PointYs() []float64

type DataList

type DataList struct {
	Items []*DataItem `json:"items,omitempty"`
}

func (*DataList) Has

func (it *DataList) Has(ds *DataItem) bool

func (*DataList) Set

func (it *DataList) Set(ds *DataItem)

type DataPoint

type DataPoint struct {
	X float64 `json:"x"`
	Y float64 `json:"y"`
	T string  `json:"t,omitempty"`
}

Jump to

Keyboard shortcuts

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