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 (
|
||||
// DefaultMACDPeriodPrimary is the long window.
|
||||
DefaultMACDPeriodPrimary = 26
|
||||
|
|
@ -287,3 +289,11 @@ func (macdl *MACDLineSeries) Render(r Renderer, canvasBox Box, xrange, yrange Ra
|
|||
style := macdl.Style.InheritFrom(defaults)
|
||||
Draw.LineSeries(r, canvasBox, xrange, yrange, style, macdl)
|
||||
}
|
||||
|
||||
// Validate validates the series.
|
||||
func (macdl *MACDLineSeries) Validate() error {
|
||||
if macdl.InnerSeries == nil {
|
||||
return fmt.Errorf("macd line series requires InnerSeries to be set")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue