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, 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 Available fields automatically 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 order_date to the X-axis.

To break down your data, drag and drop 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 Display name to Sales.

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

    Lens tutorial
  4. Click Close.

    The visualization updates to show there are only six available categories.

  5. 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, then click Stacked area from the Select a visualization dropdown.

    Lens tutorial

What’s next?edit

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