Extension:Chart/de

Category:GPL licensed extensions/de
MediaWiki-Erweiterungen
Chart
Freigabestatus: stabilCategory:Stable extensions/de
Einbindung Tag Category:Tag extensions/de
Beschreibung Renders charts
Autor(en) TODO
Kompatibilitätspolitik Der Master behält die Abwärtskompatibilität bei.
MediaWiki >= 1.44
Datenbankänderungen Nein
Lizenz GNU General Public License 3.0 oder neuer
Herunterladen Category:Extensions in Wikimedia version control/de
README
  • $wgChartCliPath
  • $wgChartServiceUrl
  • $wgChartProgressiveEnhancement
Vierteljährliche Downloads 38 (Ranked 73rd)
Übersetze die Chart-Erweiterung, wenn sie auf translatewiki.net verfügbar ist
Probleme Offene Aufgaben · Einen Fehler melden
Category:All extensions/de

Die Chart-Erweiterung bietet grundlegende interaktive Möglichkeiten zur Datenvisualisierung, die entworfen wurden, um die Graph-Erweiterung und möglicherweise auch die EasyTimeline-Erweitung zu ersetzen. Diese Erweiterung ist derzeit in der Entwicklung für Wikimedia-Wikis. Siehe Extension:Chart/Project für weitere Details zum Entwicklungsprozess.

Diese Erweiterung unterstützt folgende Diagrammtypen:

  • Linien-Diagramm
  • Flächendiagramm
  • Balken-Diagramm
  • Torten-Diagramm

Installation

Die Chart-Erweiterung erfordert die Installation der JsonConfig-Erweitung sowie das Herunterladen der JavaScript-Bibliothek Chart Renderer (genau genommen TypeScript).

Siehe die Datei README.md im Repository für eine vollständige Anleitung zur Einrichtung.

Bedienung

Alle Diagramme in diesem Beispiel können aus derselben Datenquelle erstellt werden: Data:Chart_Example_Data.tab, ein fiktiver Datensatz. Die Vorlagen für diese Seiten finden sich im Verzeichnis sample.

Um ein Diagramm zu erstellen, wird eine Diagrammdefinition benötigt, die mit der Datenquelle verbunden ist, die visualiert werden soll. A chart definition is a relatively simple JSON file. In der Diagramm-Definition ist Folgendes anzugeben:

  • license – die Lizenz, unter der das Diagramm veröffentlicht wird
  • version – die verwendete Chart-Schema-Version (derzeit ist die einzige Version 1)
  • type – die Art des darzustellenden Diagramms; derzeit unterstützt werden: line, area, bar, pie
  • source – wo die Daten für das Diagramm zu finden sind (aktuell können nur tabellarische Daten als Quelle verwendet werden)
  • xAxis -> title – Bezeichnung für die X-Achse
  • xAxis -> formatnone oder auto (default, auto has compact notation like 2K for 2000 and thousands separators)
  • yAxis -> title – Bezeichnung für die Y-Achse
  • yAxis -> format – Siehe oben.
  • mediawikiCategorieslist of MediaWiki categories to track this chart
{
    "license": "CC0-1.0",
    "version": 1,
    "source": "Chart Example Data.tab",
    "type": "line",
    "title": {
        "en": "Example Chart Title"
    },
    "xAxis": {
        "title": {
        	"en": "Example X Axis Title"
        },
        "format": "none"
    },
    "yAxis": {
        "title": {
            "en": "Example Y Axis Title"
        },
        "format": "none"
    },
    "mediawikiCategories": [
        {
            "name": "Example category",
            "sort": "Its sortkey"
        }
    ]
}

Once a chart is defined, you can render it easily using the #chart parser function. In this case, the chart data is defined in Data:Chart_Example_Data.tab, and the chart itself is defined in Data:Example.Line.chart:

{{#chart:Example.Line.chart}}

Customization

Customization of charts is currently limited. The hope is that, after testing, discussion and evaluation, solutions for customization can be found that do not compromise accessibility, device-specific rendering, or security.

Sizing

Currently, charts occupy the entire container width where you place them.

The eventual goal is to ensure that charts can be rendered legibly no matter what device they are read on; see T376845 for more details.

Theming

Currently, charts are restricted to a single default color palette. This palette has been carefully designed with accessibility in mind. The thinking behind these color choices can be explored in T369863.

Some charts do require specific color themes, for example, to represent data relating to political parties. It remains an open question of how best to support this type of customization without compromising the ability of readers with accessibility needs (e.g., color blindness) to use them.

Internationalization

Charts can only be embedded in the wiki's content language; so, for example, the "uselang" query string (e.g. ?uselang=es) will not impact the chart.

The chart format supports defining text like title and labels in different languages, so that the same chart can be used in wikis of different languages. See this example of a chart with support for multiple languages being displayed in a Spanish-language wiki.

Known issues

Types of chart

For all charts, data is expected to be arranged in columns, with the first column representing the x-axis and the following columns representing series on the y-axis.

Line

%supportDate010203040509.9.199326.9.19938.10.199322.10.1993ElvesEntsOrcsHobbitsTrollsExample Line Chart

Raw data


Bar

%supportDate010203040509.9.199326.9.19938.10.199322.10.1993ElvesEntsOrcsHobbitsTrollsExample Bar Chart

Raw data


Area

%supportDate0204060801009.9.199326.9.199319.10.1993ElvesEntsOrcsHobbitsTrollsExample Area Chart

Raw data


Pie

Pie charts are a special chart type, and data sources may require modification to be rendered appropriately.

When reading data, any non-number columns (e.g., the x-axis) will be discarded, and the sum of all rows will be represented on the chart.

For example, where multiple rows depict values for A, B, and C on numerous dates, e.g., January 1st and January 2nd, the pie chart segment for A will represent the sum of all A's row values across those dates.

ElvesEntsOrcsHobbitsTrollsElvesEntsOrcsHobbitsTrollsExample Pie Chart

Raw data

Finding existing charts

Charts that can be used in articles live on Wikimedia Commons and can be tracked using MediaWiki categories.

This query can be used as a proxy to find charts that others have made and contribute translations.

The set of wiki pages that use charts on any particular wiki can be found in the category whose name is defined at MediaWiki:chart-render-category (Category:Pages using the Chart extension on this wiki). Please make sure to connect your wiki categories to d:Q131382738 and d:Q131406605 to make the interwiki search easier.

Migrating from the Graph extension

Please see Category:Pages with disabled graphs for charts that need to be migrated to the Charts extension.

Technical documentation

Given the problems with Erweiterung:Graph, all the decisions regarding the new extension have been carefully considered, with the hope of building trust and confidence in its replacement.

So far, the technical decisions are documented in the code repository in the doc/adr folder.

Category:Extensions used on Wikimedia/de#Chart/de
Category:All extensions/de Category:Extensions in Wikimedia version control/de Category:Extensions used on Wikimedia/de Category:GPL licensed extensions/de Category:Pages using the Chart extension Category:ParserFirstCallInit extensions/de Category:Stable extensions/de Category:Tag extensions/de