Compare sales over time with Lensedit

Ready to create your own visualization with Lens? Use the following tutorial to create a visualization that lets you compare sales over time.

Before you beginedit

To start, you’ll need to add the sample ecommerce data.

Build the visualizationedit

Drag and drop your data onto the visualization builder pane.

  1. Select the kibana_sample_data_ecommerce index pattern.
  2. Click time filter calendar, then click Last 7 days.

    The fields in the data panel update.

  3. Drag and drop the taxful_total_price data field to the visualization builder pane.

    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:

Lens tutorial

Customize your visualizationedit

Make your visualization look exactly how you want with the customization options.

  1. Click Average of taxful_total_price, then change the Label to Sales.

    Lens tutorial
  2. Click Top values of category.keyword, then change Number of values to 10.

    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.

  3. To switch the chart type, click Stacked bar chart in the column, then click Stacked area from the Select a visualizations window.

    Lens tutorial

Next stepsedit

Now that you’ve created your visualization, you can add it to a dashboard or Canvas workpad.