User Story
As a Wikipedia editor, I want to be able to define a translatable title for charts so that readers have context for the chart they are viewing in their local wiki language.
Design
The styling of chart titles, including subtext, is defined in T375235.
From T375235
- Title text should be font size 16
- Title text color should be #101418 in light mode, #F8F9FA in dark mode (color-emphasized)
- Font weights can remain the defaults
Acceptance Criteria
- It's possible to define a .chart file that accept a new parameter title for all chart types (line, area, bar, pie) with a map of language codes to title names (e.g. { "title": { "en": "Energy Sources of Canada" } }.
- Charts do not automatically pull the title from the tabular data description.
- Charts with a title defined render the title of the chart on preview in the appropriate language of the wiki if available.
- Charts with a title defined can be embedded in an article to render a chart with the title in the appropriate language of the wiki if available.
- Chart titles wrap across multiple lines if they are too long to fit inside the preset dimensions.
- The chart title on the SVG returned by the chart render service is readable in full e.g. when JavaScript is disabled