Project - Horizontal Bar Chart for Total Profit of Sub-Category Product (Using React Tool and d3.js)
✓ Published0🌍 Public
AAnjan Shrestha
Last edited Apr 2, 2022
Created on Apr 2, 2022
This example shows a horizontal bar chart of total profit across product sub-categories, with blue bars on an SVG canvas and labeled axes. It loads CSV data from a GitHub gist using `d3.csv`, processes the profit values with a row function, and renders the chart in React. The visualization uses `scaleBand` for the categorical y-axis, `scaleLinear` for the profit-driven x-axis, and generates gridlines and tick labels via `xScale.ticks()`. Axis labels and bar rectangles are positioned through SVG `<g>` and `<rect>` elements within a React component.
AI-generated descriptionMIT Licensed