Skip to content

Commit

Permalink
fix: supply a valid axisconfig position default (#32335) (#32360)
Browse files Browse the repository at this point in the history
The previous default was an empty string, but empty strings are not valid in the expression. The code ends up using "left" or "top" (depending on the axis), so defaulting to either isn't really a change.

This fixes the following valid expression:

```
demodata | pointseries x=@timestamp y="mean(price)" | plot yaxis={axisConfig max=120}
```

Previously this would fail because the `position` default is invalid unless you specified a value.

<img width="617" alt="screenshot 2019-03-01 12 11 47" src="https://user-images.githubusercontent.com/404731/53660475-33104a80-3c1b-11e9-9a4c-a93116598e28.png">

Now it works as expected:

<img width="536" alt="screenshot 2019-03-01 12 11 03" src="https://user-images.githubusercontent.com/404731/53660440-212ea780-3c1b-11e9-8f4f-7d83a1009fd0.png">
  • Loading branch information
w33ble authored Mar 5, 2019
1 parent 7ee8b90 commit e735314
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const axisConfig = () => ({
types: ['string'],
help: 'Position of the axis labels - top, bottom, left, and right',
options: ['top', 'bottom', 'left', 'right'],
default: '',
default: 'left',
},
min: {
types: ['number', 'date', 'string', 'null'],
Expand Down

0 comments on commit e735314

Please sign in to comment.