/images/avatar.jpeg

I help your business extract value from data.

How to Make your Chart Dynamic in D3.js?

Hello! Welcome to this new article about data visualization. After creating an update function that allow our chart to be updated each time data will change, we will make the chart dynamic. In this post, I will show you a very simple dynamic way to switch between two datasets. The idea is to use a flag variable that will switch every period of the update function between True or False. For each situation, we display different data.

How to Manage Band Scales in D3.js?

In this article, I will show you when we need band scales and how to use them. Band scales are useful when you need to add a value to a bar chart and you don’t want to adjust the width of the SVG. Band scales allow to fit the data to the SVG width automatically and responsively. You could define the padding between each bar and between the outer bar and the side of the SVG canvas.

How to Manage Linear Scales in D3.js?

Scales are important features in D3 if you don't want to get stuck when you have big numbers in your data. 1. What are scales? Scales are functions that map from an input domain to an output range. Today we will talk about linear scales, the simplest scales in D3. 2. How to implement linear scales in D3.js? We use the scaleLinear() method to define a linear scale. const scale = d3.

How to Manage Logarithmic Scales in D3.js?

Hello! In this post I will show you why logarithmic scales can be interesting in D3 and how to manage them. 1. Why use logarithmic scales instead of linear scales? Sometimes in your data, there is a lot of variation between the biggest values and the smallest. It could be very difficult to display the whole values in one chart and keep it readable. Logarithmic scales allow you to deal with this issue.

How to Manage Ordinal Scales in D3.js?

What are ordinal scales? How to use them in D3.js? This type of scale is a bit different than these we saw before (linear, logarithmic, time). When do we need ordinal scales? Sometimes we want to use scale to work with discrete data like a collection of categories instead of continuous data. For this, we need to use and ordinal scale. We only use this type of scale when we want to associate different categories with different colors.

How to Manage Time Scales in D3.js?

In this article, I will show you the syntax in order to use time scales in D3. Time scales are very easy to understand if you already used linear scales. You can have a look at my post on linear scales here: https://www.datackling.com/post/how-to-manage-linear-scales-in-d3-js . Time scales allow you to display scale from a departure date to a final data. They are very useful when you have time series. Let’s first define a time scale with the scaleTime() method: