Skip to main content
Public

Share visualization

Send this visualization to others.

Line Chart Using a Qualitative Color Scale with D3

Public visualization

By olga-kondr on VizHub

LinkedIn caption

LinkedIn cannot prefill the post text. Copy the caption, then paste it in LinkedIn. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code

The embed preserves the visualization's visibility and project dataset permissions.

Download & exportHTML, source ZIP and authorized project data

Source ZIP contains editable visualization files; it does not include project datasets. Standalone HTML is available where authorized and packages readable referenced data for offline use. Dataset ZIP requires project read permission.

Standalone HTMLSource ZIP
Publishing & handoffCopy a client maintenance summary

Includes the canonical link, visibility, and available export formats. Confirm dataset attribution, licensing and maintenance responsibilities with the publisher.

Line Chart Using a Qualitative Color Scale with D3

0 stars1Public
OOlha
Last edited Apr 18, 2022
Created on Mar 8, 2022

This line chart tracks abortion rates over time across multiple U.S. states, with each state represented by a separate colored line using a qualitative Set1 color scale from ColorBrewer. A legend to the right identifies each state, and hovering over individual data points reveals an interactive tooltip with the year, state, and rate. The visualization is built with D3 v7, using `d3.scaleOrdinal` for color assignment, `d3.line` for path generation, and SVG rendering with animated tooltip transitions.

AI-generated description

Assignment 6 part A+

Line chart with at least 4 separate lines colored using a qualitative color scale with the appropriate legend.

I've generated and used this color schema: https://colorbrewer2.org/?type=qualitative&scheme=Set1&n=8 but later I've got that I can load colors directly fromt the https://colorbrewer2.org/export/colorbrewer.js and use in the code.

Provided example refers to the v3 of D3 and some of the methods mentioned are deprecated, e.g. scale.category10. Also http should be changed to https in order colorbrew to work.

documentation https://github.com/d3/d3/blob/main/API.md

Comments

Sign in to join the discussion.

MIT Licensed