Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

csvToChart1

Public visualization

csvToChart1

0 stars0🌍 Public
RRavanpreet Kaur Bagga
Last edited Mar 14, 2022
Created on Mar 14, 2022
Forked from Victory!

This example shows a bar chart of air pollutant measurements loaded from a CSV file, using React hooks to manage the data and Victory Charts to render the visualization. The code imports `csv` from d3 to parse the data and uses the `useState` and `useEffect` hooks to fetch and store the dataset. The `VictoryChart` and `VictoryBar` components display the parsed values, with the CSV containing columns for datetime, PM2.5, PM10, and other chemical concentrations. The chart is embedded in a React app rendered to the DOM with `ReactDOM.render`.

AI-generated description

This example shows how to load data from a CSV file using React hooks and visualize the result using Victory Charts. Inspired by this Victory example from Swizec Teller in React for Data Visualization.

Comments

Sign in to join the discussion.

MIT Licensed