From mediawiki.org
MediaWiki extensions manual
Release status: beta
Implementation Parser function
Description Allows to embed Apache ECharts in MediaWiki
Author(s) Bertrand Gorge (BertrandGorgetalk)
Latest version 1.0 (2023-04-24)
MediaWiki 1.35+
PHP 7+
Database changes No
License MIT License

Apache Echarts is a powerful charting environment. This extension allows to make full use of it in your MediaWiki setups.


You can download the extension here.


  1. Unzip the downloaded zip file.
  2. Rename and put the ECharts folder into your wikis extension folder.
  3. Include the following line at the end of your LocalSettings.php :
    wfLoadExtension( 'ECharts' );
  4. You can use the extension now! (There are no other extensions required as prerequisites and there is no setup procedure needed.)


Build your chart in the Apache Echarts editor, then copy the code and paste it in your wiki page, surrounding with {{#echarts: yourcode }}

NB : your code should only contain the option = { ... } declaration. It should not contain constants or other functions declarations.

Also, make sure your code does not contain double curly braces or (just add spaces between them), otherwise mediawiki will be very confused about where does the echarts parser function start and end.

Size and alignment[edit]

By default your charts will have a 100% width and 400px height. You can customize that by using:

width=300px |
height=300px |
yourcode }}

You can also add an alignment setting in order to float right or left (will only work if you have bootstrap in your skin):

width=300px |
height=300px |
align=right |
yourcode }}

Known issues[edit]

This extension will analyse the ECharts code by using the JS function eval. This might allow malicious code to get into your wiki pages. You don't want that. The only other option is to use JSON.parse(...) but the Echarts code is not strict Json so that would fail unless you rework your JSON data using a JSON beautifier/linter of some sort. If your wiki is opened to anonymous contributions, don't use this extension. You've been warned! (NB: this could be configured using a configuration option - PR welcome)