Visualizing the Data
- Read
- Discuss
In this article you will learn about how to visualize data and query results in the form of different graphs and charts. You will also learn how to create and present a dashboard.
Create a Notebook
First step is to create a notebook and select “SQL” as default language.
Run query
Inside the notebook, run the following query to get the number of records for each quality.
Select quality ,count(*) from cleanedwinedata group by quality order by quality;
Visualize Data using Bar Graph
Upon executing the query, you will get the tabular result. In order to visualize the data click the + sign on the top of the result table and then select “Visualizations”.
Then from the visualization type, select bar graph and databricks will automatically convert your result set into a bar graph with quality on x-axis and count on y-axis.
Visualize data using Pie Chart
Run the following query in the command box:
Select round(alcohol) from cleanedwinedata;
Upon executing the query, you will get the tabular result.
In order to visualize the data click the + sign on the top of the result table and then select “Visualizations”.
Then from the visualization type, select pie chart. Databricks will ask you to add another axis. So, from the left hand side click “Add new Column” and databricks will automatically convert your result set into a pie chart with alcohol percentage in its segments as shown in the image below.
Visualize Data using Box Plot
Run the following query in the command box:
Select quality,ph from cleanedwinedata order by quality;
Upon executing the query, you will get the tabular result. In order to visualize the data click the + sign on the top of the result table and then select “Visualizations”.
Then from the visualization type, select box and databricks will automatically convert your result set into a box plot showing the range of ph for each quality
Create a Dashboard
Once you are done creating your graphs, click on file and select “Create new Dashboard”.
Give a suitable name to your dashboard and move around your charts to arrange them in a manner that you want.
After arranging them, click the “Present dashboard” button on the right hand side and you will see a beautiful dashboard having all the charts at one place where you can hover upon each chart and view its values.
Leave a Reply
You must be logged in to post a comment.