kibana/docs/visualize/lens.asciidoc
Kaarina Tungseth 71badc67de
[DOCS] [Lens] 7.9 docs refresh (#72301)
* [DOCS] Lens refresh for 7.9

* Clean up

* Review comments from Wylie
2020-07-29 10:40:53 -05:00

174 lines
5.7 KiB
Plaintext

[role="xpack"]
[[lens]]
== Lens
beta[]
*Lens* is a simple and fast way to create visualizations of your {es} data. To create visualizations,
you drag and drop your data fields onto the visualization builder pane, and *Lens* automatically generates
a visualization that best displays your data.
With Lens, you can:
* Use the automatically generated visualization suggestions to change the visualization type.
* Create visualizations with multiple layers and indices.
* Add your visualizations to dashboards and Canvas workpads.
To get started with *Lens*, select a field in the data panel, then drag and drop the field on a highlighted area.
[role="screenshot"]
image::images/lens_drag_drop.gif[Drag and drop]
You can incorporate many fields into your visualization, and Lens uses heuristics to decide how to apply each one to the visualization.
TIP: Drag-and-drop capabilities are available only when Lens knows how to use the data. If *Lens* is unable to automatically generate a visualization,
you can still configure the customization options for your visualization.
[float]
[[apply-lens-filters]]
==== Change the data panel fields
The fields in the data panel are based on the selected <<index-patterns, index pattern>> and <<set-time-filter,time filter>>.
To change the index pattern, click it, then select a new one. The fields in the data panel automatically update.
To filter the fields in the data panel:
* Enter the name in *Search field names*.
* Click *Filter by type*, then select the filter. To show all of the fields in the index pattern, deselect *Only show fields with data*.
[float]
[[view-data-summaries]]
==== Data summaries
To help you decide exactly the data you want to display, get a quick summary of each field. The summary shows the distribution of values within the selected time range.
To view the field summary information, navigate to the field, then click *i*.
[role="screenshot"]
image::images/lens_data_info.png[Data summary window]
[float]
[[change-the-visualization-type]]
==== Change the visualization type
*Lens* enables you to switch between any supported visualization type at any time.
*Suggestions* are shortcuts to alternate visualizations that *Lens* generates for you.
[role="screenshot"]
image::images/lens_suggestions.gif[Visualization suggestions]
If you'd like to use a visualization type that is not suggested, click the visualization type,
then select a new one.
[role="screenshot"]
image::images/lens_viz_types.png[]
When there is an exclamation point (!)
next to a visualization type, Lens is unable to transfer your data, but
still allows you to make the change.
[float]
[[customize-operation]]
==== Change the aggregation and labels
For each visualization, Lens allows some customizations of the data.
. Click *Drop a field here* or the field name in the column.
. Change the options that appear. Options vary depending on the type of field.
+
[role="screenshot"]
image::images/lens_aggregation_labels.png[Quick function options]
[float]
[[layers]]
==== Add layers and indices
Area, line, and bar charts allow you to visualize multiple data layers and indices so that you can compare and analyze data from multiple sources.
To add a layer, click *+*, then drag and drop the fields for the new layer.
[role="screenshot"]
image::images/lens_layers.png[Add layers]
To view a different index, click it, then select a new one.
[role="screenshot"]
image::images/lens_index_pattern.png[Add index pattern]
[float]
[[lens-tutorial]]
=== Lens tutorial
Ready to create your own visualization with Lens? Use the following tutorial to create a visualization that
lets you compare sales over time.
[float]
[[lens-before-begin]]
==== Before you begin
To start, you'll need to add the <<add-sample-data, sample ecommerce data>>.
[float]
==== Build the visualization
Drag and drop your data onto the visualization builder pane.
. Select the *kibana_sample_data_ecommerce* index pattern.
. Click image:images/time-filter-calendar.png[], then click *Last 7 days*.
+
The fields in the data panel update.
. Drag and drop the *taxful_total_price* data field to the visualization builder pane.
+
[role="screenshot"]
image::images/lens_tutorial_1.png[Lens tutorial]
To display the average order prices over time, *Lens* automatically added in *order_date* field.
To break down your data, drag the *category.keyword* field to the visualization builder pane. Lens
knows that you want to show the top categories and compare them across the dates,
and creates a chart that compares the sales for each of the top three categories:
[role="screenshot"]
image::images/lens_tutorial_2.png[Lens tutorial]
[float]
[[customize-lens-visualization]]
==== Customize your visualization
Make your visualization look exactly how you want with the customization options.
. Click *Average of taxful_total_price*, then change the *Label* to `Sales`.
+
[role="screenshot"]
image::images/lens_tutorial_3.1.png[Lens tutorial]
. Click *Top values of category.keyword*, then change *Number of values* to `10`.
+
[role="screenshot"]
image::images/lens_tutorial_3.2.png[Lens tutorial]
+
The visualization updates to show there are only six available categories.
+
Look at the *Suggestions*. An area chart is not an option, but for the sales data, a stacked area chart might be the best option.
. To switch the chart type, click *Stacked bar chart* in the column, then click *Stacked area* from the *Select a visualizations* window.
+
[role="screenshot"]
image::images/lens_tutorial_3.png[Lens tutorial]
[float]
[[lens-tutorial-next-steps]]
==== Next steps
Now that you've created your visualization, you can add it to a dashboard or Canvas workpad.
For more information, refer to <<dashboard,Dashboard>> or <<canvas,Canvas>>.