Page MenuHomePhabricator

Add support for basic bar charts
Closed, ResolvedPublic5 Estimated Story Points

Description

User Story

As a Wikipedia editor, I want to be able to create basic bar charts that can be embedded in articles so that I can enhance encyclopedic content through data visualization.

Acceptance Criteria
  • It's possible to define a .chart file that accept a new parameter of "type": "bar" with one or multiple series using the same parameters as "type": "line"
  • "type": "bar" definitions generate a basic bar chart on preview (like this example).
  • "type": "bar" definitions can be embedded in an article to render a basic bar chart.
  • Must have a legend. See T375233.
  • Must use default color scheme (patterns for each bar will be added as part of T376198.

Design

Chart standards

Bar chart specifics

  • Bars on the chart should have a borderRadius: [4,4,0,0]

Demo

Light mode example

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

Dark mode example

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

Details

Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
Require chart legend and unify chart options for line and bar chartsrepos/mediawiki/services/chart-renderer!34auderequire-legendmain
Add bar chart implementationrepos/mediawiki/services/chart-renderer!31audebar-charts-T373345main
Customize query in GitLab

Event Timeline

LGoto triaged this task as Medium priority.Aug 26 2024, 6:37 PM
CCiufo-WMF set the point value for this task to 5.Aug 26 2024, 6:42 PM
CCiufo-WMF moved this task from Backlog to Up Next on the Charts board.
CCiufo-WMF edited projects, added Charts (Sprint 5); removed Charts.
CCiufo-WMF moved this task from Incoming to Ready for Dev on the Charts (Sprint 5) board.
CCiufo-WMF edited projects, added Charts; removed Charts (Sprint 5).
CCiufo-WMF edited projects, added Charts (Sprint 8); removed Charts.

"Must use default color scheme and patterns for each bar." - I think this should be a separate task, to define the colors in a theme and the patterns.

Jdlrobson reassigned this task from CCiufo-WMF to aude.
Jdlrobson moved this task from Doing to Ready for Signoff on the Charts (Sprint 8) board.
Jdlrobson updated the task description. (Show Details)
Jdlrobson moved this task from Ready for Signoff to Doing on the Charts (Sprint 8) board.
Jdlrobson subscribed.

This needs a bit more work to show the legend by default, tweak the styling and to centralize the colors (which likely depends on T376656)

Jdlrobson updated the task description. (Show Details)
Jdlrobson moved this task from Doing to Ready for Signoff on the Charts (Sprint 8) board.