Reader small image

You're reading from  MongoDB Fundamentals

Product typeBook
Published inDec 2020
PublisherPackt
ISBN-139781839210648
Edition1st Edition
Tools
Concepts
Right arrow
Authors (4):
Amit Phaltankar
Amit Phaltankar
author image
Amit Phaltankar

Amit Phaltankar is a software developer and a blogger experienced in building lightweight and efficient software components. He specializes in wiring web-based applications and handling large-scale data sets using traditional SQL, NoSQL, and big data technologies. He is experienced in many technology stacks and loves learning and adapting to newer technology trends. Amit is passionate about improving his skill set and loves guiding and grooming his peers and contributing to blogs. He is also an author of MongoDB Fundamentals.
Read more about Amit Phaltankar

Juned Ahsan
Juned Ahsan
author image
Juned Ahsan

Juned Ahsan is a software professional with more than 14 years of experience. He has built software products and services for companies and clients such as Cisco, Nuamedia, IBM, Nokia, Telstra, Optus, Pizzahut, AT&T, Hughes, Altran, and others. Juned has a vast experience in building software products and architecting platforms of different sizes from scratch. He loves to help and mentor others and is a top 1% contributor on StackOverflow. He is passionate about cognitive CX, cloud computing, artificial intelligence, and NoSQL databases.
Read more about Juned Ahsan

Michael Harrison
Michael Harrison
author image
Michael Harrison

Michael Harrison started his career at the Australian telecommunications leader Telstra. He worked across their networks, big data, and automation teams. He is now a lead software developer and the founding member of Southbank Software, a Melbourne based startup that builds tools for the next generation of database technologies.
Read more about Michael Harrison

Liviu Nedov
Liviu Nedov
author image
Liviu Nedov

Liviu Nedov is a senior consultant with more than 20 years of experience in database technologies. He has provided professional and consulting services to customers in Australia and Europe. Throughout his career, he has designed and implemented large enterprise projects for customers like Wotif Group, Xstrata Copper/Glencore, and the University of Newcastle and Energy, Queensland. He is currently working at Data Intensity, which is the largest multi-cloud service provider for applications, databases, and business intelligence. In recent years, he is actively involved in MongoDB NoSQL database projects, database migrations, and cloud DBaaS (Database as a Service) projects.
Read more about Liviu Nedov

View More author details
Right arrow

12. Data Visualization

Overview

This chapter will introduce you to MongoDB Charts, which offers the best way to create visualizations using data from a MongoDB database. You will start by learning the basics of the MongoDB Charts data visualization engine, then go on to create new dashboards and charts to understand the difference between the various types of graphs. You will also integrate and customize graphs with other external applications. By the end of this chapter, you will be well versed in the basic concepts of the Charts PaaS cloud interface and be able to perform the steps necessary to build useful graphs.

Introduction

The visual representation of data is extremely useful for reporting as well as for business presentations. The advantages of using charts for data visualization in science, statistics, and mathematics cannot be overstated. Graphs and charts can effectively communicate essential information for business decisions to be made, in much the same way that movies can tell stories by using images in motion.

MongoDB has developed a new, integrated tool for data visualization, called MongoDB Charts. This is a relatively new feature, with its first release in the second quarter of 2018. MongoDB Charts allows users to perform quick data representation from a MongoDB database without writing code in a programming language such as Java or Python. Currently, there are two different implementations of MongoDB Charts:

  • MongoDB Charts PaaS (Platform as a Service): This refers to the cloud service for Charts. This version of Charts is fully integrated with Atlas cloud projects...

Complex Charts

In previous sections, you saw how easy it is to use MongoDB Charts in Atlas. While the user interface is very intuitive and easy to use, it is also very powerful. There are many options available in MongoDB Charts so that data from the database can be preprocessed, grouped, and displayed in various ways. We'll take a look at more advanced configuration topics in this section.

Preprocessing and Filtering Data

As discussed previously, charts access the database through data sources that are defined in Charts. By default, all documents from a database collection are selected to build a new chart. Moreover, the data fields in Charts will inherit the original database JSON document data format.

Also note that a data source cannot alter or modify the database. In a real-life scenario, it happens quite often that the data format is not ideal for presenting via a chart. The data must be prepared, or the data format needs to be altered in some way before it is...

Channels

The encoding channels are one of the most important aspects of data visualization. The channel decides how the data is visualized in the chart. Users can get confusing charts or totally unexpected results if they select the wrong channel type. Therefore, a proper understanding of encoding channels is essential for efficient chart building and data visualization.

As shown in previous examples, the encoding channels lie under the Encode tab in the Chart Builder, just under the chart sub-type selection buttons:

Figure 12.39: Encoding channels

Each encoding channel has a name and a type. The channel name defines the target in the graph—that is, the end to which the channel will be used. For example, the X Axis channel name indicates that the channel is providing the values for the horizontal axis of the graph. It is clear in this case that we are going to have a Cartesian bi-dimensional chart. The channel type defines what type of data is expected...

Integration

So far, the topics in this chapter have focused on describing the functionality of MongoDB Charts PaaS. We have learned that users can easily build dashboards and charts using data sources from the Atlas cloud database. The last topic of this chapter addresses the end result of a MongoDB chart—that is, how the dashboards and charts can be used for presentations and applications.

One option is to save the charts as images and integrate them into MS PowerPoint presentations or to publish them as web page content. While this option is very simple, it has one main disadvantage in that the chart image is static. Therefore, the chart is not updated when the database is updated.

Another option is to use MongoDB Charts as a presentation tool. This option guarantees that charts are refreshed and rendered each time the database is updated. Nevertheless, this option is probably not ideal, as the content is limited to the MongoDB Charts user interface and cannot be easily...

Summary

This chapter differed from previous chapters in that it focused on the Charts user interface rather than MongoDB programming. The results that can be achieved using the Atlas cloud Charts module are impressive, allowing users to focus on data rather than programming and presentation.

There are various chart types and sub-types to choose from, which makes Charts both more effective and easier to work with. MongoDB Charts can also be easily integrated with other web applications using the EMBED CODE option, which is an advantage for developers because they do not need to deal with another programming module to plot graphs in their applications. In the next chapter, we will look at a business use case in which MongoDB will be used for managing the backend.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
MongoDB Fundamentals
Published in: Dec 2020Publisher: PacktISBN-13: 9781839210648
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Authors (4)

author image
Amit Phaltankar

Amit Phaltankar is a software developer and a blogger experienced in building lightweight and efficient software components. He specializes in wiring web-based applications and handling large-scale data sets using traditional SQL, NoSQL, and big data technologies. He is experienced in many technology stacks and loves learning and adapting to newer technology trends. Amit is passionate about improving his skill set and loves guiding and grooming his peers and contributing to blogs. He is also an author of MongoDB Fundamentals.
Read more about Amit Phaltankar

author image
Juned Ahsan

Juned Ahsan is a software professional with more than 14 years of experience. He has built software products and services for companies and clients such as Cisco, Nuamedia, IBM, Nokia, Telstra, Optus, Pizzahut, AT&T, Hughes, Altran, and others. Juned has a vast experience in building software products and architecting platforms of different sizes from scratch. He loves to help and mentor others and is a top 1% contributor on StackOverflow. He is passionate about cognitive CX, cloud computing, artificial intelligence, and NoSQL databases.
Read more about Juned Ahsan

author image
Michael Harrison

Michael Harrison started his career at the Australian telecommunications leader Telstra. He worked across their networks, big data, and automation teams. He is now a lead software developer and the founding member of Southbank Software, a Melbourne based startup that builds tools for the next generation of database technologies.
Read more about Michael Harrison

author image
Liviu Nedov

Liviu Nedov is a senior consultant with more than 20 years of experience in database technologies. He has provided professional and consulting services to customers in Australia and Europe. Throughout his career, he has designed and implemented large enterprise projects for customers like Wotif Group, Xstrata Copper/Glencore, and the University of Newcastle and Energy, Queensland. He is currently working at Data Intensity, which is the largest multi-cloud service provider for applications, databases, and business intelligence. In recent years, he is actively involved in MongoDB NoSQL database projects, database migrations, and cloud DBaaS (Database as a Service) projects.
Read more about Liviu Nedov