Help:Gantt format

From semantic-mediawiki.org
(Redirected from Help:Gantt format)
Gantt format
Outputs the result as Gantt charts.
Further Information
Provided by: Extension "Semantic Result Formats"
Added: 3.1.0
Removed: still supported
Requirements: Mermaid extension
Format name: gantt
Enabled? Indicates whether the result format is enabled by default upon installation of the respective extension. no
Authors: Sebastian Schmid
Categories: charts
Table of Contents

The result format gantt is used to format query results as Gantt charts. It was introduced with version 3.1.01 of extension "Semantic Result Formats"Provides additional formats for semantic queries and requires as a software dependency version 2.0.0 or later of extension "Mermaid" (MediaWiki.org).

Parameters

Parameter Type Default Description
diagramtitle text empty Diagram name
theme text default Diagram theme
axisformat text %m/%d/%Y X-axis: Date format
statusmapping text empty ⧼srf-paramdesc-gantt-statusmapping⧽
prioritymapping text empty ⧼srf-paramdesc-gantt-prioritymapping⧽
titletopmargin whole number 25 Top margin of the diagram title
barheight whole number 20 Height of task bars
leftpadding whole number 75 Width of section title
bargap whole number 4 Vertical distance of tasks bars from the margin

The following parameters are available2:

  • axisformat = Allows to format the axis of your chart. Defaults to "%m/%d/%Y"3.
  • diagramtitle = Allows to set the title of the chart. Defaults to "" meaning no title.
  • sortkey = Allows to set how the task in should be sorted in the chart. Defaults to "" meaning natural sorting. Possible predefined values are title, startdate and enddate.
  • statusmapping = Allows to map internal values set to the property holding the data values for the status of the tasks. Defaults to "" meaning no mapping is provided. Available values are active and done. It is possible to map multiple properties to a task status.
Example: |statusmapping=2 (in progress)=>active;3 (completed)=>done
  • prioritymapping = Allows to map internal values set to the property holding the data values for the priority of the tasks. Defaults to "" meaning no mapping is provided. Available value is crit. It is possible to map multiple properties to a task priority.
Example: |prioritymapping=1 (high)=>crit; 2 (normal)=>crit
  • leftpadding = Allows to set the width of the section title. Defaults to "75".
  • titletopmargin = Allows to set the margin of the chart title. Defaults to "25".
  • barheight = Allows to set the height of the tasks. Defaults to "20".
  • bargap = Allows to set the vertical distance between the tasks. Defaults to "4".

Example[edit]

Syntax
{{#ask:
 [[Category:Issue]]
 |?Display Title=task
 |?Issue Status=status
 |?Start Date=startdate
 |?End Date=enddate
 |?Related To Epic=section
 |?Issue Priority=priority
 |format=gantt
 |axisformat=%d/%m/%Y
 |diagramtitle=Title of the chart
 |statusmapping=2 (in progress)=>active;3 (completed)=>done
 |prioritymapping=1 (high)=>crit; 2 (normal)=>crit
 |sortkey=title
 |leftpadding=120
 |titletopmargin=25
 |bargap=10
 |barheight=50
}}

Installation[edit]

This section describes installing the required extension "Mermaid" (MediaWiki.org) with Composer. To do this, add the following as the last line of the "require" section in your "composer.local.json" file, not forgetting to add a comma to the end of the preceding line:

"mediawiki/mermaid": "~3.1"

Now run the following command from the root directory of your wiki to complete the installation:

composer update --no-dev

Finally, add the following line to your "LocalSettings.php" after the inclusion of the Semantic Result Formats extension:

wfLoadExtension( 'Mermaid' );
$srfgFormats[] = 'gantt';


References

  1. ^  Semantic Result Formats: GitHub pull request gh:srf:467
  2. ^  For more info see Gantt chart: general documentation
  3. ^  For more info see Gantt charts: scale parameter documentation