You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
720 B
33 lines
720 B
package indicator |
|
|
|
// 绘图属性 |
|
type Plot struct { |
|
Props map[string]any // 长度颜色 |
|
Series []PlotSeries // 需要绘图的时间序列列表 |
|
} |
|
|
|
type PlotSeries struct { |
|
State string `json:"state"` // vector, stateName |
|
Series SeriesType `json:"series"` // 绘图类型 线/柱 |
|
Props map[string]any `json:"props"` // 绘图属性 |
|
SeriesFn func(vector float64, states map[string]float64) map[string]any |
|
} |
|
|
|
// SeriesType 序列值绘图类型 |
|
type SeriesType int32 |
|
|
|
const ( |
|
SeriesNone SeriesType = iota |
|
SeriesLine |
|
SeriesHistogram |
|
SeriesArea |
|
) |
|
|
|
// Series 绘图颜色 |
|
type Color string |
|
|
|
const ( |
|
ColorRed Color = "red" |
|
ColorGreen Color = "green" |
|
ColorYellow Color = "yellow" |
|
)
|
|
|