🌍 Public
Revenue by Passenger Class
This visualization shows the total revenue collected from each passenger class on the Titanic, aggregated from a CSV dataset loaded via `loadTable`. The p5.js `draw()` function iterates through every row, summing the `Fare` values per `Pclass` and mapping the totals to horizontally scaled rectangles. Revenue amounts are labeled at the end of each bar, with an x-axis manually marked in increments of 1000 from 0 to 5000. The chart uses the Canvas API through p5.js's `rect` and `text` functions, and the axis lines are drawn with p5.js’s `line` method.
AI-generated descriptionA bare minimum HTML page demonstrating use of CSS and JavaScript.
See also React Starter.
MIT Licensed

![[A2] Revenue by Class (Bar Chart)](/viz/9e6169c75d3841eab31b5e2de0d54af5/social-image.png?v=ee9ed86398bf487090a6cf7d6af6553b)
![A2 - Revenue by Class [Bar Chart]](/viz/38cd5ff7569d4f60a33ef4b36b7d4844/social-image.png?v=d961f1b1acb9422aa921a63dc5f43072)



![A2 - Revenue by Class [Bar Chart]](/viz/772a7840cefc4e6a9af80ab2819d4070/social-image.png?v=6b493a0c8fad44878bd64d852051fd89)

Comments
Sign in to join the discussion.