5 changed files with 54 additions and 3 deletions
@ -0,0 +1,33 @@ |
|||||||
|
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" |
||||||
|
) |
||||||
Loading…
Reference in new issue