Template:Progress bar: Difference between revisions

From Constructed Worlds Wiki
Jump to navigation Jump to search
miraheze:conworlds>Emelxa
(Created page with "<div style=" width:{{{width|75%}}}; {{#ifeq: {{{center|yes}}} | yes | margin:auto; text-align:center;}}"> {{#ifeq: {{{header|yes}}} | yes | <p> {{Big|1= '''{{#expr:...")
 
m (1 revision imported)
 
(No difference)

Latest revision as of 01:03, 8 July 2023

20% completed (estimate)

   

Template documentation[view] [edit] [history] [purge]

Usage

{{Progress bar|value}}

This template draws a progress bar. By default, the value to supply as the parameter is the percent, from 0 to 100 (e.g. 1 would mean 1%, .1 would be 0.1%). The text label of the progress bar will always be rounded to the nearest tenth of a percent (rounding up if the hundreds digit is 5; e.g. 50.15 would round to 50.2%). If a value isn't specified or is invalid, the bar displays 0%. Values greater than 100% will display incorrectly, although the text label will be correct.

Optional parameters

  • height = height of the progress bar in pixels; defaults to 2
  • width = width of the progress bar; defaults to 75%
  • text = message to display after %; defaults to: completed (estimate)
  • total = amount to use as the denominator (instead of 100), allows the template to compute the percentage on the fly
  • header = no (or any value other than "yes", which is the default) suppresses the display of the percentage on the top line
  • color1 = the colour of the filled portion of the progress bar
  • color2 = the colour of the background of the progress bar

Examples

Default configuration

{{Progress bar|5}} :

5% completed (estimate)

   

With custom header text

{{Progress bar|5|text=done}} :

5% done

   

Without header text

{{Progress bar|80|header=no|text=does not display here}} :

   

Custom height and width

{{Progress bar|80|height=4|width=50%}} :

80% completed (estimate)

   

Custom total

{{Progress bar|5|total=5}} :

100% completed (estimate)