Search⌘ K

Setting Up and Configuring the Axes

Explore how to set up and customize axes in D3.js simple graphs. Learn to change font styles, sizes, and apply CSS classes to avoid overlapping labels, enhancing the readability and appearance of your data visualizations.

We'll cover the following...

Basic graph

As referenced in the “A Simple Graph” lesson where we initially developed our simple graph, the axes of that graph had no styling or configuration changes made to them at all. One of the results of this is that the font size, type, number of ticks, and the way that the values are represented is very much at the default settings. This means that when we change our initial graph:

And when we compress the margins or graph size, we end up with overlapping axes labels that are not really suitable for the purpose:

Luckily, the ...