[DOCS] Add s an example for Timelion yaxis function (#96429) (#96445)

This commit is contained in:
Kaarina Tungseth 2021-04-07 10:37:52 -05:00 committed by GitHub
parent bf055e5256
commit 80a80d2ca4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -43,6 +43,40 @@ If the value of your parameter contains spaces or commas you have to put the val
.es(q='some query', index=logstash-*)
[float]
[[customize-data-series-y-axis]]
===== .yaxis() function
{kib} supports many y-axis scales and ranges for your data series.
The `.yaxis()` function supports the following parameters:
* *yaxis* — The numbered y-axis to plot the series on. For example, use `.yaxis(2)` to display a second y-axis.
* *min* — The minimum value for the y-axis range.
* *max* — The maximum value for the y-axis range.
* *position* — The location of the units. Values include `left` or `right`.
* *label* — The label for the axis.
* *color* — The color of the axis label.
* *units* — The function to use for formatting the y-axis labels. Values include `bits`, `bits/s`, `bytes`, `bytes/s`, `currency(:ISO 4217 currency code)`, `percent`, and `custom(:prefix:suffix)`.
* *tickDecimals* — The tick decimal precision.
Example:
[source,text]
----------------------------------
.es(index= kibana_sample_data_logs,
timefield='@timestamp',
metric='avg:bytes')
.label('Average Bytes for request')
.title('Memory consumption over time in bytes').yaxis(1,units=bytes,position=left), <1>
.es(index= kibana_sample_data_logs,
timefield='@timestamp',
metric=avg:machine.ram)
.label('Average Machine RAM amount').yaxis(2,units=bytes,position=right) <2>
----------------------------------
<1> `.yaxis(1,units=bytes,position=left)` &mdash; Specifies the first y-axis for the first data series, and changes the units on the left.
<2> `.yaxis(2,units=bytes,position=left)` &mdash; Specifies the second y-axis for the second data series, and changes the units on the right.
[float]
==== Tutorial: Create visualizations with Timelion