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.
54 lines
1.4 KiB
54 lines
1.4 KiB
package indicator |
|
|
|
type Plot0 struct { |
|
State string `json:"state"` // vector, stateName |
|
Type PlotSeriesType `json:"series"` // 绘图类型 线/柱 |
|
Props PlotProps `json:"props"` // 绘图属性 |
|
Exps []PlotExp `json:"exps"` // 绘图条件表达式 |
|
} |
|
|
|
type PlotExp struct { |
|
Exp string `json:"exp"` // 绘图条件表达式 |
|
Props PlotProps `json:"props"` // 条件表达式成立时绘图属性 |
|
} |
|
|
|
// 指标绘图 |
|
type Plot struct { |
|
Props PlotProps // 长度颜色等属性 |
|
Series PlotSeries |
|
StateSeries []PlotSeries // 需要绘图的时间序列列表 |
|
} |
|
|
|
// 指标绘图: 逻辑化 -> 配置化 |
|
type PlotSeries struct { |
|
State string `json:"state"` // vector, stateName |
|
Type PlotSeriesType `json:"series"` // 绘图类型 线/柱 |
|
Props PlotProps `json:"props"` // 绘图属性 |
|
State2Props map[string]map[float64]PlotProps `json:"state2Props"` // state转绘图属性 |
|
} |
|
|
|
// 指标绘图 |
|
type PlotProps map[string]any |
|
|
|
// PlotSeriesType 序列值绘图类型 |
|
type PlotSeriesType int32 |
|
|
|
const ( |
|
PlotSeriesNone PlotSeriesType = iota |
|
PlotSeriesLine |
|
PlotSeriesHistogram |
|
PlotSeriesArea |
|
) |
|
|
|
// Series 绘图颜色 |
|
const ( |
|
ColorRed string = "red" |
|
ColorGreen string = "green" |
|
ColorYellow string = "yellow" |
|
ColorBlue string = "blue" |
|
) |
|
|
|
const ( |
|
// calc tokens: > >= == < <= + - * / % |
|
// 大于等于小于 In, NotIn ... |
|
)
|
|
|