diff --git a/widgets/linechart/linechart_test.go b/widgets/linechart/linechart_test.go index 6d3e2781..305fbc2c 100644 --- a/widgets/linechart/linechart_test.go +++ b/widgets/linechart/linechart_test.go @@ -371,7 +371,6 @@ func TestLineChartDraws(t *testing.T) { desc: "custom Y scale, negative only, values fit", opts: []Option{ YAxisCustomScale(-200, -100), - YAxisAdaptive(), }, canvas: image.Rect(0, 0, 20, 10), writes: func(lc *LineChart) error { diff --git a/widgets/linechart/options.go b/widgets/linechart/options.go index 7f23c06b..f631bbe2 100644 --- a/widgets/linechart/options.go +++ b/widgets/linechart/options.go @@ -140,12 +140,15 @@ type customScale struct { // i.e. smaller than the minimum or larger than the maximum. // Both the minimum and the maximum must be valid numbers and the minimum must // be smaller than the maximum. +// +// Providing this option also sets YAxisAdaptive. func YAxisCustomScale(min, max float64) Option { return option(func(opts *options) { opts.yAxisCustomScale = &customScale{ min: min, max: max, } + opts.yAxisMode = axes.YScaleModeAdaptive }) }