Creating dynamic presentations using Kibana Canvas


preview imageInformation Technology
by Anurag Srivastava,Apr 10, 2020, 3:01:55 PM | 6 minutes |

Kibana Canvas is a data presentation tool using which we can create live presentations that can show data directly from Elasticsearch. This way it helps us to avoid the manual data update in the presentation slides. Let's take a use case where we need to present some figures and graphs of some KPIs from the data source. In this case, the most traditional way is to fetch those values, charts, etc, and paste them in the PPT/Google slide and present it to the management team. Now if there is a meeting next week then do it again by copy-pasting the data to the slides. So it is a very tedious task to every time fetch the information and put them into the slide and make it presentable.

Canvas helps us to solve this problem as we can showcase the live figures and charts using live data from Elasticsearch so if there is any change during the presentation we can get the most recent data in the presentation. The only constraint is that our data should be in Elasticsearch. So if it is in RDBMS, NoSQL, or CSV then we need to first push the data in Elasticsearch. If you want to know how to do that then you can refer to my previous blogs on BQStack.


Getting the data for the presentation:

For this blog, I am going to use the Kibana sample e-commerce data which we can import from the Kibana home page, please refer to the below screenshot:


                                               


After importing the data, we can go to the "Discover" tab of Kibana to explore the data. Below JSON document is showing one document from the index pattern "kibana_sample_data_ecommerce":

{
  "_index": "kibana_sample_data_ecommerce",
  "_type": "_doc",
  "_id": "u3QdZHEBN4mC-_91Ho9J",
  "_version": 1,
  "_score": null,
  "_source": {
    "category": [
      "Women's Clothing"
    ],
    "currency": "EUR",
    "customer_first_name": "Elyssa",
    "customer_full_name": "Elyssa Tran",
    "customer_gender": "FEMALE",
    "customer_id": 27,
    "customer_last_name": "Tran",
    "customer_phone": "",
    "day_of_week": "Friday",
    "day_of_week_i": 4,
    "email": "elyssa@tran-family.zzz",
    "manufacturer": [
      "Oceanavigations"
    ],
    "order_date": "2020-04-10T12:11:31+00:00",
    "order_id": 713114,
    "products": [
      {
        "base_price": 74.99,
        "discount_percentage": 20,
        "quantity": 1,
        "manufacturer": "Oceanavigations",
        "tax_amount": 0,
        "product_id": 16965,
        "category": "Women's Clothing",
        "sku": "ZO0261902619",
        "taxless_price": 59.99,
        "unit_discount_amount": 14.998,
        "min_price": 40.49,
        "_id": "sold_product_713114_16965",
        "discount_amount": 14.998,
        "created_on": "2016-12-16T12:11:31+00:00",
        "product_name": "Maxi dress - black",
        "price": 59.992,
        "taxful_price": 59.99,
        "base_unit_price": 74.99
      }
    ],
    "sku": [
      "ZO0261902619"
    ],
    "taxful_total_price": 59.99,
    "taxless_total_price": 59.99,
    "total_quantity": 1,
    "total_unique_products": 1,
    "type": "order",
    "user": "elyssa",
    "geoip": {
      "country_iso_code": "US",
      "location": {
        "lon": -74,
        "lat": 40.8
      },
      "region_name": "New York",
      "continent_name": "North America",
      "city_name": "New York"
    }
  },
  "fields": {
    "order_date": [
      "2020-04-10T12:11:31.000Z"
    ],
    "products.created_on": [
      "2016-12-16T12:11:31.000Z"
    ]
  },
  "sort": [
    1586520691000
  ]
}

Above JSON is showing a single document of the "kibana_sample_data_ecommerce" index pattern where we can see the customer details along with the products.


Creating the Canvas Presentation:

Now let us see how we can create a presentation in Canvas using the above index pattern data. So for that, we need to do the following:

  1. We need to open the Kibana URL and after login click on the "Canvas" link from the left menu.
  2. This will open the canvas page, now click on the "Create workpad" button. This will open a black workpad.
  3. Now click on "Add element" which will open a popup screen to select the element type. Now click on the "Text" element as we can create the first workpad to present the introduction.
  4. We can edit the text using the right side markup text area. Here we can also modify the text style, etc. Please refer to the below screenshot:

                                                

    The above diagram is showing a workpad on which we have created the title and subtitle using the text element type.


  5. After adding the title and subtitle to the workpad, we can add another workpad to represent the next presentation slide. For that we need to click on the "Page 1" link on the bottom that will open the slide view, now click on the plus icon on the bottom right side of the page. This will create a new blank workpad.
  6. On this blank workpad, we can show the live e-commerce data which we have imported for demo purpose, but we can use any Elasticsearch index data for creating a presentation in Canvas.
  7. Now just for an example let us say we want to display a donut chart to show the sale of different products. So here we need to click on the "Add element" button again and this time we have to pick the "Donut chart".
  8. This will show a donut chart on the workpad, just click on the chart and click on the "Data" link from the right pane.
  9. Click on "Demo data" which is selected by default, now click on the "Select" option under the "Elasticsearch SQL" box.
  10. Under the Query text area we can put the following query:

    SELECT category, COUNT(category) AS count FROM "kibana_sample_data_ecommerce" GROUP BY category
    After applying the query, click on the "Save" button.

  11. Now click on the "Display" link to open the Display pane. Select the value as a category under the slice labels and select the value as count under slice angles.
  12. We can also change the legend position and inner radius, etc under the chart style. Please refer to the below screenshot:


          
    The above diagram is showing a donut chart with the percentage of different categories which we have derived from the e-commerce data.

In the same way, we can add more workpads and can add different other visualization, images, tables, or text, etc. Once we are done with the workpads modifications, we can save the Kibana workpad by changing the name from the Workpad settings pane on the right side of the page.


Showing the Canvas Presentation:
Now we can click on the "full screen" icon on the top left side of the page or we can click the "alt+F" shortcut to open the workpad in full-screen mode. Now using the left and right keys of the keyboard we can navigate to the previous and next slides.

Whenever there is any change in the data it will be reflected automatically in the Canvas workpad. This way using the Kibana Canvas, we can create a presentation and can present the live data to the management.  In case of any query please leave your comment.


Other Blogs on Elastic Stack:

Introduction to Elasticsearch

Elasticsearch Installation and Configuration on Ubuntu 14.04
Log analysis with Elastic stack 
Elasticsearch Rest API
Basics of Data Search in Elasticsearch
Elasticsearch Rest API
Wildcard and Boolean Search in Elasticsearch
Configure Logstash to push MySQL data into Elasticsearch
Configure Logstash to push MongoDB data into Elasticsearch
Load CSV Data into Elasticsearch
Metrics Aggregation in Elasticsearch
Bucket Aggregation in Elasticsearch
How to create Elasticsearch Cluster


In case of any doubt please leave your comments. You can also follow me on Twitter: https://twitter.com/anu4udilse


If you found this article interesting, then you can explore “
Mastering Kibana 6.0”, “Kibana 7 Quick Start Guide”, “Learning Kibana 7”, and “Elasticsearch 7 Quick Start Guide” books to get more insight about Elastic Stack, how to perform data analysis, and how you can create dashboards for key performance indicators using Kibana.


Comments (2)

  • user image
    jitender yadav
    Apr 19, 2020, 3:10:27 PM

    very helpful

  • user image
    Anurag Srivastava
    Apr 19, 2020, 8:15:42 PM

    Thanks Jitender :)

Leave a comment

Related Blogs

preview thumbnail
Securing your Elastic Stack

Nov 4, 2019, 7:06:01 PM | Anurag Srivastava

preview thumbnail
Introduction to OpenAPI Specification

May 9, 2020, 6:58:33 AM | Anurag Srivastava

preview thumbnail
Geo distance search using Elasticsearch

May 16, 2020, 8:16:33 PM | Anurag Srivastava

preview thumbnail
Elasticsearch Installation and Configuration on Ubuntu 14.04

May 7, 2018, 11:55:02 AM | Lovish Sharma

Top Blogs

preview thumbnail
Geo distance search using Elasticsearch

May 16, 2020, 8:16:33 PM | Anurag Srivastava

preview thumbnail
Creating dynamic presentations using Kibana Canvas

Apr 10, 2020, 3:01:55 PM | Anurag Srivastava

preview thumbnail
Securing your Elastic Stack

Nov 4, 2019, 7:06:01 PM | Anurag Srivastava

preview thumbnail
Introduction to OpenAPI Specification

May 9, 2020, 6:58:33 AM | Anurag Srivastava

preview thumbnail
Elasticsearch Installation and Configuration on Ubuntu 14.04

May 7, 2018, 11:55:02 AM | Lovish Sharma