adding validation.
This commit is contained in:
parent
3ea3c9ac10
commit
e735797037
20 changed files with 285 additions and 7 deletions
|
|
@ -1,5 +1,7 @@
|
|||
package chart
|
||||
|
||||
import "fmt"
|
||||
|
||||
const (
|
||||
// DefaultEMAPeriod is the default EMA period used in the sigma calculation.
|
||||
DefaultEMAPeriod = 12
|
||||
|
|
@ -99,3 +101,11 @@ func (ema *EMASeries) Render(r Renderer, canvasBox Box, xrange, yrange Range, de
|
|||
style := ema.Style.InheritFrom(defaults)
|
||||
Draw.LineSeries(r, canvasBox, xrange, yrange, style, ema)
|
||||
}
|
||||
|
||||
// Validate validates the series.
|
||||
func (ema *EMASeries) Validate() error {
|
||||
if ema.InnerSeries == nil {
|
||||
return fmt.Errorf("ema series requires InnerSeries to be set")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue