feat: support label for series, #1

This commit is contained in:
vicanso 2022-01-15 10:43:38 +08:00
parent a577d30eb8
commit eb421892fe
8 changed files with 148 additions and 7 deletions

View file

@ -35,6 +35,11 @@ var (
_ chart.LastValuesProvider = (*BaseSeries)(nil)
)
type SeriesLabel struct {
Show bool
Offset chart.Box
}
// BaseSeries represents a line on a chart.
type BaseSeries struct {
Name string
@ -48,6 +53,8 @@ type BaseSeries struct {
XValues []float64
YValues []float64
Label SeriesLabel
}
// GetName returns the name of the time series.