Skip to main content
100%

Bar chart on iris-dataset

✓ Published1🌍 Public
HHalvorte
Last edited Sep 19, 2023
Created on Sep 19, 2023

This example presents a horizontal bar chart that visualizes the sepal length of different iris species classes from the classic Iris dataset. The chart encodes the measured sepal length along the x-axis, with each bar positioned by its corresponding flower class on the y-axis. The visual encoding clearly compares the distribution of sepal lengths across the three species. Using D3 v5, the code loads the dataset from a CSV file, scales the data with `d3.scaleLinear` and `d3.scaleBand`, and renders the visualization as SVG elements within an HTML canvas. Axis labels and a title are also generated using D3's axis utilities.

AI-generated description

An example showing the capabilities of VizHub:

  • Loads D3 via UNPKG.
  • Demonstrates use of import from "d3".
  • Demonstrates use of import from local ES6 modules.
MIT Licensed

Similar vizzes