Skip to main content
100%

XML Parsing

✓ Published0🌍 Public
Mmbostock
Last edited Feb 9, 2016
Created on May 16, 2015

This example shows a bar chart of letter frequencies in English, ordered from A to Z. It demonstrates how to load an external XML file using `d3.xml` and parse it with the selectors API, specifically `querySelectorAll` and `getAttribute`. The code uses D3 v3 to bind the parsed data to SVG rectangles, with ordinal and linear scales for the axes. Data resides in a simple XML file with `<letter>` elements, and the chart updates on hover with a color change.

AI-generated description

A variant of the bar chart example demonstrating how to parse a simple XML file and traverse it using the selectors API. (I recommend converting your data to TSV or CSV instead of parsing XML, if you can, of course.)

gpl-3.0 Licensed

Similar vizzes