Skip to main content
Public

Share visualization

Loading preview…

Bar Chart

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Bar Chart

0
Xxieyunli111
Last edited Jul 18, 2022
Created on Jul 17, 2022

This example presents a bar chart of option prices, displaying each financial instrument’s code on the y-axis and its price on the x-axis. The visualization uses React with D3 v5, parsing data from a CSV file and rendering SVG rectangles. It employs `scaleLinear` for the x-axis, `scaleBand` for the y-axis, and `axisLeft` to generate tick labels, all within a custom `render` function. The data source is `data.csv`, containing option codes and prices, which are multiplied by 100 during preprocessing.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

index.js first parse the data then define the render()

Comments

Sign in to join the discussion.

MIT Licensed