feat: support null value for line chart

This commit is contained in:
vicanso 2022-09-15 20:09:00 +08:00
parent bb9af986be
commit 50605907c7
5 changed files with 32 additions and 2 deletions

View file

@ -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)
}