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"
|
||||
|
||||
// HistogramSeries is a special type of series that draws as a histogram.
|
||||
// Some peculiarities; it will always be lower bounded at 0 (at the very least).
|
||||
// This may alter ranges a bit and generally you want to put a histogram series on it's own y-axis.
|
||||
|
|
@ -55,3 +57,11 @@ func (hs HistogramSeries) Render(r Renderer, canvasBox Box, xrange, yrange Range
|
|||
style := hs.Style.InheritFrom(defaults)
|
||||
Draw.HistogramSeries(r, canvasBox, xrange, yrange, style, hs)
|
||||
}
|
||||
|
||||
// Validate validates the series.
|
||||
func (hs HistogramSeries) Validate() error {
|
||||
if hs.InnerSeries == nil {
|
||||
return fmt.Errorf("histogram series requires InnerSeries to be set")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue