Skip to content

Commit

Permalink
Merge d2533da into 73a6514
Browse files Browse the repository at this point in the history
  • Loading branch information
mum4k committed Feb 16, 2019
2 parents 73a6514 + d2533da commit b675a51
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 0 additions & 1 deletion widgets/linechart/linechart_test.go
Expand Up @@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions widgets/linechart/options.go
Expand Up @@ -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
})
}

Expand Down

0 comments on commit b675a51

Please sign in to comment.