package indicator // 指标绘图 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 绘图颜色 type Color string const ( ColorRed Color = "red" ColorGreen Color = "green" ColorYellow Color = "yellow" )