linegraph

package
v1.0.6-beta.1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

README

Line Graph Component

Data Struct

Field Description
Title The title of line graph
SubTitle Deprecated,Not recommended
Dimensions Defining multiple lines in a Line Graph
XAxis X-axis specific data
YAxis Y-axis specific data
XOptions X-axis property definition
YOptions Y-axis property definition
Inverse inverted xAxis and yAxis

Axis Struct

Field Description
Dimension Dimension name
Values Axis specific data

Options Struct

Field Description
Dimension The title of line graph
Structure Data Structure
Inverse Reverse axis values

Demo

Line Graph Demo

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Axis

type Axis struct {
	Dimension string        `json:"dimension,omitempty"` // The xAxis can have no dimensions
	Values    []interface{} `json:"values"`
}

Axis defined struct.

type CustomData

type CustomData interface {
	CustomDataPtr() interface{}
	EncodeFromCustomData(customDataPtr interface{}, stdDataPtr *Data)
	DecodeToCustomData(stdDataPtr *Data, customDataPtr interface{})
}

CustomData is kv's custom data handler.

type CustomInParams

type CustomInParams interface {
	CustomInParamsPtr() interface{}
	EncodeFromCustomInParams(customInParamsPtr interface{}, stdInParamsPtr *cptype.ExtraMap)
	DecodeToCustomInParams(stdInParamsPtr *cptype.ExtraMap, customInParamsPtr interface{})
}

CustomInParams is kv's custom inParams handler.

type CustomState

type CustomState interface {
	CustomStatePtr() interface{}
	EncodeFromCustomState(customStatePtr interface{}, stdStatePtr *cptype.ExtraMap)
	DecodeToCustomState(stdStatePtr *cptype.ExtraMap, customStatePtr interface{})
}

CustomState is kv's custom state handler.

type Data

type Data struct {
	Title      string     `json:"title"`
	SubTitle   string     `json:"subTitle"`
	Dimensions []string   `json:"dimensions"`
	XAxis      *Axis      `json:"xAxis"` // x axis
	YAxis      []*Axis    `json:"yAxis"` // y axis
	XOptions   *Options   `json:"xOptions"`
	YOptions   []*Options `json:"yOptions"`
	Inverse    bool       `json:"inverse"` // inverted xAxis and yAxis
	sync.RWMutex
}

Data includes list.

func New

func New(title string) *Data

New .

func (*Data) SetXAxis

func (d *Data) SetXAxis(values ...interface{})

SetXAxis .

func (*Data) SetXOptions

func (d *Data) SetXOptions(options *Options)

SetXOptions .

func (*Data) SetYAxis

func (d *Data) SetYAxis(dimension string, values ...interface{})

SetYAxis .

func (*Data) SetYOptions

func (d *Data) SetYOptions(options ...*Options)

SetYOptions .

type DataBuilder

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

DataBuilder .

func NewDataBuilder

func NewDataBuilder() *DataBuilder

NewDataBuilder .

func (*DataBuilder) Build

func (d *DataBuilder) Build() *Data

Build .

func (*DataBuilder) WithTitle

func (d *DataBuilder) WithTitle(title string) *DataBuilder

WithTitle .

func (*DataBuilder) WithXAxis

func (d *DataBuilder) WithXAxis(values ...interface{}) *DataBuilder

WithXAxis .

func (*DataBuilder) WithXOptions

func (d *DataBuilder) WithXOptions(options *Options) *DataBuilder

WithXOptions .

func (*DataBuilder) WithYAxis

func (d *DataBuilder) WithYAxis(dimension string, values ...interface{}) *DataBuilder

WithYAxis .

func (*DataBuilder) WithYOptions

func (d *DataBuilder) WithYOptions(options ...*Options) *DataBuilder

WithYOptions .

type ILineGraph

type ILineGraph interface {
	cptype.IComponent
	ILineGraphStdOps
}

ILineGraph line graph interface

type ILineGraphStdOps

type ILineGraphStdOps interface{}

ILineGraphStdOps .

type Options

type Options struct {
	Dimension string                   `json:"dimension,omitempty"`
	Structure *structure.DataStructure `json:"structure"`
	Inverse   bool                     `json:"inverse"` // inverted values
}

Options .

type OptionsBuilder

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

OptionsBuilder .

func NewOptionsBuilder

func NewOptionsBuilder() *OptionsBuilder

NewOptionsBuilder .

func (*OptionsBuilder) Build

func (o *OptionsBuilder) Build() *Options

Build .

func (*OptionsBuilder) WithDimension

func (o *OptionsBuilder) WithDimension(dimension string) *OptionsBuilder

WithDimension .

func (*OptionsBuilder) WithEnable

func (o *OptionsBuilder) WithEnable(enable bool) *OptionsBuilder

WithEnable .

func (*OptionsBuilder) WithPrecision

func (o *OptionsBuilder) WithPrecision(precision structure.Precision) *OptionsBuilder

WithPrecision .

func (*OptionsBuilder) WithType

func (o *OptionsBuilder) WithType(dataType structure.Type) *OptionsBuilder

WithType .

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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