kmgChart

package
v0.0.0-...-05317bf Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2015 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AvgTimeFloatPairToOneFloat

func AvgTimeFloatPairToOneFloat(input []TimeFloatPair) float64

func NewChartFromTimeFloatPairWithTitle

func NewChartFromTimeFloatPairWithTitle(title string, inputList []TimeFloatPair) kmgBootstrap.Panel

func TimeContainInRange

func TimeContainInRange(startTime time.Time, timeRange time.Duration, t time.Time) bool

func TplJsCDN

func TplJsCDN() string

Types

type Chart

type Chart struct {
	Width  string  //可选
	Height string  //可选
	Option *option `json:"options"`
	JS     string  //在 option 赋值后,渲染数据前调用
	// contains filtered or unexported fields
}

func CreateLineFloatVector2

func CreateLineFloatVector2(inputList []FloatVector2) *Chart

func CreateLineFromTimeFloatPair

func CreateLineFromTimeFloatPair(inputList []TimeFloatPair) *Chart

func NewLineXIsAnyYIsNumber

func NewLineXIsAnyYIsNumber(data []Vector2) *Chart

X 是任意东西,均匀分布,类似枚举;Y 是数值,离散非均匀的

func (Chart) GetOptionString

func (l Chart) GetOptionString() string

func (Chart) HtmlRender

func (l Chart) HtmlRender() string

type FloatVector2

type FloatVector2 struct {
	X float64
	Y float64
}

type LODLevel

type LODLevel struct {
	Range   time.Duration
	Density time.Duration //每个 Density 时间间隔,取该时间间隔内的平均值
}

type TimeFloatPair

type TimeFloatPair struct {
	X time.Time
	Y float64
}

func AccTimePerSecondFloatPair

func AccTimePerSecondFloatPair(input []TimeFloatPair, Density time.Duration) []TimeFloatPair

累计时间分析 在 density 内 y 之和除以 density

func AvgTimeFloatPair

func AvgTimeFloatPair(input []TimeFloatPair, Density time.Duration) []TimeFloatPair

平均时间分析 在 density 内 y 之和除以 y 的数量

func AvgTimeFloatPairOnRoundTime

func AvgTimeFloatPairOnRoundTime(input []TimeFloatPair, dur time.Duration) (outList []TimeFloatPair)

整点时间分析, 用于做累计型数据抽样. 比如每秒数据转成每10分钟数据.(保证重复执行会得到完全一致的数据.) 允许数据中间出现空缺.出现如果整个数据段数据都出现空缺,这个时间段在抽样后的数据里面没有数据. 最后一截数据直接忽略.

func LODForTimeFloatLine

func LODForTimeFloatLine(input []TimeFloatPair, levelList []LODLevel) []TimeFloatPair

type TimeFloatPairSortByDESC

type TimeFloatPairSortByDESC []TimeFloatPair

func (TimeFloatPairSortByDESC) Len

func (l TimeFloatPairSortByDESC) Len() int

func (TimeFloatPairSortByDESC) Less

func (l TimeFloatPairSortByDESC) Less(i, j int) bool

func (TimeFloatPairSortByDESC) Swap

func (l TimeFloatPairSortByDESC) Swap(i, j int)

type Title

type Title struct {
	Text    string `json:"text"`
	Subtext string `json:"subtext"`
}

type Vector2

type Vector2 struct {
	X interface{}
	Y interface{}
}

Jump to

Keyboard shortcuts

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