feat: support null value for line chart
This commit is contained in:
parent
bb9af986be
commit
50605907c7
5 changed files with 32 additions and 2 deletions
13
charts.go
13
charts.go
|
|
@ -24,6 +24,7 @@ package charts
|
|||
|
||||
import (
|
||||
"errors"
|
||||
"math"
|
||||
"sort"
|
||||
|
||||
"github.com/wcharczuk/go-chart/v2"
|
||||
|
|
@ -51,6 +52,18 @@ func SetDefaultHeight(height int) {
|
|||
}
|
||||
}
|
||||
|
||||
var nullValue = math.MaxFloat64
|
||||
|
||||
// SetNullValue sets the null value, default is MaxFloat64
|
||||
func SetNullValue(v float64) {
|
||||
nullValue = v
|
||||
}
|
||||
|
||||
// GetNullValue gets the null value
|
||||
func GetNullValue() float64 {
|
||||
return nullValue
|
||||
}
|
||||
|
||||
type Renderer interface {
|
||||
Render() (Box, error)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue