marginConvention
✓ Published0🌍 Public
RRonolibert
Last edited Jun 19, 2017
Created on Jun 19, 2017
This example demonstrates a basic SVG chart layout using the margin convention in D3. It shows how to structure a visualization by setting explicit margins, calculating the inner width and height, and translating a group element to establish the plotting area. The code uses d3.select and append to create an SVG, then draws a light blue rectangle with a green stroke to represent the chart region. The chart background is light gray, with the margin values set to top 0, right 0, bottom 20, and left 25. The full SVG dimensions are 425 by 625 pixels, rendered with D3 v4.
AI-generated descriptionBuilt with blockbuilder.org
mit Licensed