Skip to content

Commit

Permalink
[DOCS] Add s an example for Timelion yaxis function (#96429)
Browse files Browse the repository at this point in the history
  • Loading branch information
KOTungseth authored Apr 7, 2021
1 parent 63a177e commit 532145b
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions docs/user/dashboard/timelion.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,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
Expand Down

0 comments on commit 532145b

Please sign in to comment.