Formatted time labels for an axis with v7
✓ Published0🌍 Public
Dd3noob
Last edited Jun 18, 2021
Created on Jun 18, 2021
This example shows a line graph of stock closing prices over time. The x-axis displays formatted date labels (year-month-day) that are rotated 65 degrees to prevent overlap. The chart is built with D3 v7, using `d3.csv` to load date and close data from a CSV file, `d3.scaleTime` and `d3.scaleLinear` for the axes, and a line generator for the path. The `d3.axisBottom` tick format and rotation are applied to the SVG text elements.
AI-generated descriptionThis is a simple line graph demonstrating rotated / formatted axis labels.
This graph is part of the code samples for the update to the book D3 Tips and Tricks to version 7 of d3.js.
mit Licensed