Realtime Graphs and Charts with Plotly and Firebase
Key Takeaways
This video demonstrates how to create real-time graphs and charts with Plotly and Firebase, using Angular 4 on the frontend. It covers building a basic 2D line chart, a 3D topographical chart, and a ternary chart that updates in real-time with data from Firebase.
Full Transcript
in the age of big data and deep learning data visualization is an extremely important tool for many applications in this episode we're going to combine the plotly JS Library along with angular and Firebase to create three different types of charts that are capable of handling real-time data we'll start by building a basic 2D line chart and then we'll build up to a 3D topographical chart then we'll finish up with a tary chart that's capable of staying in sync with the real-time back end on Firebase the first step is to to install the plotly JS Library which we can do with npm install plotly.js flag saave then add it to the script section in the angular-cli Json file it's worth noting that plot Le is a pretty big Library so if you want to slim it down a little bit go to your node modules and find just the script that you need for your app in this case we're using the entire Library which is probably overkill for most situations then in your typing. D file add the plotly class so it's recognized by typescript now we can start building our first line chart this chart will just be completely static just to show you the general concepts behind plotly in the HTML create an empty div and then give it a template reference variable named chart then in the component typescript we'll use viewchild as well as element ref then we're going to build this chart service in The Next Step once we start using live data from Firebase so you can ignore that for now and we'll also use the low Dash Library so to get a hold of the div in the HTML we use viewchild and then reference that chart variable that we Nam there then we'll name it l in the typescript which is more or less an angular convention then to actually build a plotly chart there are three basic variables that you need to be aware of first we have element which is the HTML element that will be replaced by the chart and then we have data that's the actual data that's going to be displayed in the chart here we have a few numbers on the X and Y axis that will create a basic line chart with a curve the third variable is style which defines the style options that vary from chart to chart then to put everything together we just call plot le. plot and pass it The Element data and style back in the app we can see we get the simple line chart but it's packed with a bunch of features from plotly such as the ability to zoom in and zoom out you can save it as an image and do all kinds of different stuff to it so that was pretty simple now let's build a 3D chart that uses data from Firebase so I'm building a basic service here that injects the angular fire database then it Returns the data set we want as a Firebase list observable in this example my database is a collection of arrays with each array having its own set of data points these data points correspond to the elevation of a mountain and I'll provide a link to the data set in the description now getting back to the component we create a new function for this chart but this time we pass it the data as an argument like before we set the element variable then we format the data specifically for 3D charts so we pass the data as the z-axis and set the type to surface then for the layout or style we set a few simple parameters here just to make the chart look good and again we call plot le. plot and pass it these variables now we need to pass the chart some data so we do this during ngon a nit by subscribing to the data set in the database in this example we don't expect our data to change so we're just going to take one and then subscribe to it so we don't have a long running subscription and then we'll pass the data from the subscription to the Topo chart function back in the app you can see we get this really cool 3D interactive chart based on our data and Firebase and there's a ton of ways you can customize this so make sure to check out the plotly docs and the community for more inspiration on what you can do so the last type of chart that we'll build is a chart that can actually update its appearance based on real-time data for this example I have some user rankings that will rank a user based on their abilities as an analyst designer or developer then we're going to visualize this data on a Turner chart which is basically just a triangle that compares three different types of data first we're going to add a function to our service that will allow us to make this update in Firebase it just references a single data point and updates it with some new data then in the component we're going to subscribe to the data in NG on a nit but before we pass the data to the function we're going to Pro mer the chart existing in that element then we'll go ahead and call the function that builds the chart but before we get there let's create a function that will just randomize the data for a certain data point then you can attach this function to a click event so the user can randomize the data just with a click of a button now let's build this Turner chart we start by passing it The Element as usual then we map each of the three categories down to an array of its values in most cases you'll need to map your data down to an array for to work with any kind of data chart the rest of the code is mostly just presentational so we just add a few options to give it some nice looking Styles plotly has a big library of example so you can usually find a good starting chart for most situations now back in the app if we click the button that says realtime update we can see the red circle moving around the screen that's because it's actually being updated in the back end in Firebase that's it for realtime charts with plotly and Firebase if this video helped you please like And subscribe and if you want help building your own features consider becoming a pro subscriber at angular firebase.com you'll receive a free copy of my book as well as one-on-one project Consulting thanks for watching and I'll see you next time [Music]
Original Description
Learn how to connect realtime data to Plot.ly with the Firebase database and Angular 4 on the frontend. In this episode, I build three different graphs and charts designed to handle realtime data streams.
Full Lesson: https://angularfirebase.com/lessons/realtime-charts-with-plot-ly/
Plot.ly JS: https://plot.ly/javascript/
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Fireship · Fireship · 39 of 60
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
▶
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Angular 4 Development and Production Environments with Firebase
Fireship
OAuth with Angular and Firebase Tutorial
Fireship
Anonymous Authentication with Angular and Firebase - Lazy Registration
Fireship
Angular Router Guards for Firebase Users
Fireship
Angular Firebase CRUD App with NoSQL Database Tutorial
Fireship
Upload Files from Angular to Firebase Storage
Fireship
How to Deploy an Angular App to Firebase Hosting
Fireship
Sharing Data between Components in Angular
Fireship
Loading Spinners for Asynchronous Firebase Data
Fireship
Angular 4 Transactional Email with Google Firebase Cloud Functions
Fireship
Firebase Database Rules Tutorial
Fireship
Autocomplete Search with Angular4 and Firebase
Fireship
Reddit Inspired Upvoting System with Angular and Firebase NoSQL
Fireship
Angular Drag-and-Drop File Uploads to Firebase Storage
Fireship
Text Translation with Firebase Cloud Functions onWrite and Angular 4
Fireship
Custom Usernames with Firebase Authentication
Fireship
Twitter-Inspired Follow Unfollow Feature with Firebase and Angular 4
Fireship
Simple Pagination with Firebase and Angular 4
Fireship
How to Connect Firebase Users to their Data - 3 Methods
Fireship
Add Toast Message Notifications to your Angular App
Fireship
Facebook-Inspired Reactions System with Angular and Firebase
Fireship
Learn NgModule in Angular with Examples
Fireship
Lazy Loading Components in Angular 4
Fireship
Stripe Checkout Payments with Angular and Firebase - Part 1
Fireship
Process Stripe Payments with Firebase Cloud Functions - Part 2
Fireship
Selling Digital Content in Angular with Stripe Payments - Part 3
Fireship
Angular 4 Full Text Search with Algolia - Part 1
Fireship
Algolia with Firebase Cloud Functions - Part 2
Fireship
Firebase Phone Authentication in Angular 4
Fireship
Top 7 RxJS Concepts for Angular Developers
Fireship
Learn Angular Animations with 5 Examples
Fireship
Advanced Firebase Data Filtering (Multi-Property)
Fireship
Realtime Maps with Mapbox + Firebase + Angular
Fireship
Angular Reactive Forms with Firebase Database Backend
Fireship
Send Push Notifications in Angular with Firebase Cloud Messaging
Fireship
Top 7 Ways to Debug Angular 4 Apps
Fireship
Infinite Scroll with Angular and Firebase
Fireship
Use TypeScript with Firebase Cloud Functions
Fireship
Realtime Graphs and Charts with Plotly and Firebase
Fireship
Role-Based User Permissions in Firebase
Fireship
User Presence System in Realtime - Online, Offline, Away
Fireship
Location-based Queries with GeoFire and Angular Google Maps
Fireship
Angular ngrx Redux Quick Start Tutorial
Fireship
Angular Ngrx Effects with Firebase Database
Fireship
Progressive Web Apps with Angular
Fireship
Angular Ngrx with Firebase Google OAuth User Authentication
Fireship
RxJS Quick Start with Practical Examples
Fireship
Send SMS Text Messages with Twilio and Firebase
Fireship
Firebase Database Performance Profiling
Fireship
Native Desktop Apps with Angular and Electron
Fireship
Subscription Payments with Stripe, Angular, and Firebase
Fireship
Firestore with AngularFire5 Quick Start Tutorial
Fireship
Angular HTTP Client Quick Start Tutorial
Fireship
Google Sign-In with Firestore Custom User Data
Fireship
Star Review System from Scratch with Firestore + Angular
Fireship
Angular Chatbot with Dialogflow (API.ai)
Fireship
Learn @ngrx/entity and Feature Modules
Fireship
Infinite Scroll Pagination with Firestore
Fireship
Faster Firestore via Data Aggregation
Fireship
Contentful - CMS for Angular Progressive Web Apps
Fireship
More on: Data Literacy
View skill →Related AI Lessons
⚡
⚡
⚡
⚡
Next.js vs Remix vs SvelteKit: Which Framework Should You Learn?
Dev.to · Etrit Neziri
Had my Frontend Developer interview with Capgemini (Application Developer) today, and I wanted to…
Medium · JavaScript
10 Frontend Developer Tools to Boost Productivity in 2026
Medium · Programming
10 Frontend Developer Tools to Boost Productivity in 2026
Medium · JavaScript
🎓
Tutor Explanation
DeepCamp AI