Page MenuHomePhabricator

Define color scheme for charts
Closed, ResolvedPublic

Assigned To
Authored By
Jdlrobson
Sep 19 2024, 9:02 PM
Referenced Files
F57579279: Screenshot 2024-10-01 at 15.28.57.png
Oct 1 2024, 7:35 PM
F57579278: Screenshot 2024-10-01 at 15.28.47.png
Oct 1 2024, 7:35 PM
F57579275: Screenshot 2024-10-01 at 15.31.07.png
Oct 1 2024, 7:35 PM
F57579272: Screenshot 2024-10-01 at 15.30.26.png
Oct 1 2024, 7:35 PM
F57579273: Screenshot 2024-10-01 at 15.29.54.png
Oct 1 2024, 7:35 PM
F57579274: Screenshot 2024-10-01 at 15.29.46.png
Oct 1 2024, 7:35 PM
F57579277: Screenshot 2024-10-01 at 15.28.13.png
Oct 1 2024, 7:35 PM
F57579276: Screenshot 2024-10-01 at 15.27.59.png
Oct 1 2024, 7:35 PM

Description

Background

Result of spike T369863. Currently it is possible to define the exact colors of a chart. This means that sometimes the chart may have accessibility issues. As a result we want to define a default color recommended color scheme for all chart types.

User story

As a user I want to visualize the data using color in a way that makes sense for my specific data.

Requirements

  1. A default color scheme is defined
  2. The default color scheme works in dark mode
  3. When a color scheme is not provided in a chart definition they get our recommended color scheme

Open questions

  1. Do we want to provide variations of the default chromatic palette, i.e. subdued and vibrant? Not now.
  2. Do we want to provide monochromatic palettes for each color? Not now.
  3. Do we want to provide other template palettes, such as for things like temperature or politics? Not now.
  4. When a user customizes a palette, do they have to customize every color? Ideally not. Whichever data values in the series are not set with a custom color, the default color for that data value will be provided, according to the default set/order of colors for charts.

Design

  • The default color scheme is called categorical.
  • The order the colors appear in this list is intentional and should be the order the colors appear in within a given chart.
  • 10 data values is our current max, so there are 10 colors.
  • Colors may be customized. Any colors provided for specific data values are overwritten, otherwise the default color is provided in the order determined here.
  • The color scheme stays the same across light and dark modes.
  • The order and values of colors:
"#4b77d6",
"#eeb533",
"#fd7865",
"#80cdb3",
"#269f4b",
"#b0c1f0",
"#9182c2",
"#d9b4cd",
"#b0832b",
"#a2a9b1"

Demos

Line

Bar

Pie

Stacked area

Examples

Line, light mode

Screenshot 2024-10-01 at 15.27.59.png (690×1 px, 120 KB)

Line, dark mode

Screenshot 2024-10-01 at 15.28.13.png (674×1 px, 120 KB)

Bar, light mode

Screenshot 2024-10-01 at 15.29.46.png (676×1 px, 48 KB)

Bar, dark mode

Screenshot 2024-10-01 at 15.29.54.png (654×1 px, 47 KB)

Pie, light mode

Screenshot 2024-10-01 at 15.30.26.png (574×822 px, 44 KB)

Pie, dark mode

Screenshot 2024-10-01 at 15.31.07.png (566×808 px, 48 KB)

Stacked area, light mode

Screenshot 2024-10-01 at 15.28.47.png (676×1 px, 80 KB)

Stacked area, dark mode

Screenshot 2024-10-01 at 15.28.57.png (670×1 px, 80 KB)

Acceptance criteria

  • Default color scheme is determined
  • Placeholder task is created for implementation

Event Timeline

DTorsani-WMF renamed this task from Create color scheme for charts to Define color scheme for charts.Sep 21 2024, 12:05 AM

We have decided to use hex codes from the Codex color palette for charts. Whether these can and should be dynamically tied to Codex using tokens will be explored and decided at a later time if the need arises.

CCiufo-WMF edited projects, added Charts (Sprint 7); removed Charts.
CCiufo-WMF moved this task from Incoming to Doing on the Charts (Sprint 7) board.