แม่แบบ:Medical cases chart/doc

== คำอธิบาย**
This template should be used for all outbreak, epidemic and pandemic medical cases charts based on Bar box to maintain consistency. It displays horizontal bars for up to 5 different classifications of cases for each valid date or interval. It offers two columns to make numbers explicit and to show relative or absolute changes. It also uses a sophisticated toggling system to control the visualization of data rows across many months or years. It is designed to be flexible, but still standardizes some parts of the chart. This template should be transcluded in other templates, NOT in article pages. Suggest features in the talk page or code them if they're neither controversial nor incompatibility prone.

**การใช้งาน**
It may be desirable to make a specific outbreak chart have different widths depending on the page it is displayed. The barwidth parameter can be used to achieve this. For example,  will display the chart wide in the template page itself, but will allow different widths when the outbreak template is transcluded with this parameter in article pages.
numwidth is a sequence of the initials of none, thin, medium, wide, extra wide and default, and it determines the maximum width of each number in the data columns. Therefore, one should be chosen that minimizes the total width, but which doesn't make the numbers break/wrap on mobile view. Using 2 or 4 characters allocates one or two data columns, respectively. For example, mw sets the right1 value column to medium and the right1 change column to wide. mwnt sets the right1 value column to medium, the right1 change column to wide, the right2 value column to none, and the right2 change column to thin.
The navbar links are contructed like this: outbreak data/location3/location2/*location medical cases chart. outbreak may be more descriptive than disease to avoid page name collisions. So, for example, COVID-19 charts have COVID-19 pandemic. location has "the " internally removed and is capitalized to become *location.
By default, the "Last X days" button toggles days which intersect with those of the last months. This happens regardless of the state (activated or not) of the month buttons. In fact, due to limitations of  custom collapsing, toggles are stateless (a workaround is used to simulate two 'states'). All in all, this can lead to situations where clicking one button causes unintuitive toggling like creating date gaps. nooverlap works around this issue by forcing the buttons of the last months to not overlap with the "Last X days" button. The result is usually a partial last month button, "Mon XX-XX", where XX are the first and last days of the month that the button affects. Extra info in the main bug discussion.
To display absolute change in the first column and percent change in the second column, set the following (AA represents any two allowed characters, # represents the classification number being shown, which should be the same for right1data and right2data):

numwidth=AAnw

right1data=#

changetype1=a

right2data=#

changetype2=o

**ข้อมูล**
The data parameter should be populated by a sequence of lines containing a different set of parameters separated by semicolons, ;.
All values are optional, and empty values can be represented by sequential semicolons (e.g. ;;). Omitting the date will treat the row as a date interval, unless the date can be automatically interpolated (for 1 day intervals). This is mostly done when no new cases are reported. Omitting a classification value makes a 0 width stacked bar and ommiting all values or the line itself is recommended to depict dates where no data is reported.
The expression for total in the 3rd cases classification has deaths and recoveries automatically subtracted from it. If a manual calculation of the number in that classification (generally active cases) is wanted, use alttot1. The same applies to the expression for total in the 5th cases classification and alttot2.
The 1st column #, 1st column change, 2nd column #, and 2nd column change values can be automatically calculated if omitted. The 1st column values will be automatically calculated if right1 is omitted or # of cases, and the 2nd column values will be automatically calculated if # of deaths. If right1 or right2 are set to other values, the columns can still be automatically calculated by setting right1data and right2data to the classification number wanted for display in columns 1 and 2, respectively (e.g. 1 for deaths, 2 for recoveries, 3 for total, etc.).  The changes in the first and second columns are automatically wrapped in parentheses.
The other parameters=values can be any number of the parameters below and their values, separated by semicolons. See the examples.
alttot1    = alternate expression for active cases (3rd cases classification)
alttot2    = alternate expression for number in the 5th cases classification
firstright1= whether a change in the first column is not applicable (n.a.) (yesno)
firstright2= whether a change in the second column is not applicable (n.a.) (yesno)
enddate    = end date of interval if automatic one causes incorrect toggling behavior required if chart ends with interval
note0      = note text post-fixed to the date, that should create a minimum space consuming object, like a note link, to avoid wrapping
note1      = like note0, only post-fixed to column 1
note2      = like note1, only post-fixed to column 2

**ตัวอย่าง**

**ตัวอย่างการประยุกต์**

**ข้อมูลแม่แบบ**
{
	"description": "Produces charts based on  for outbreak, epidemic and pandemic medical cases.",
	"format": "_=_\n",
	"params": {
		"barwidth": {
			"label": "Bar width",
			"description": "width of the stacked bars area (thin|medium|wide|auto)",
			"type": "string",
			"default": "medium"
		},
		"numwidth": {
			"label": "Number width",
			"description": "maximum width of the numbers in the right columns (AA or AAAA)←(n|t|m|w|x|d)",
			"type": "string",
			"default": "mm",
			"example": "mwnt",
			"suggested": true
		},
		"float": {
			"label": "Float",
			"description": "side of the page where the chart will be located (left|center|right|none)",
			"type": "string",
			"default": "right"
		},
		"pretitle": {
			"label": "Pretitle",
			"description": "text at the beginning of the title",
			"type": "string"
		},
		"disease": {
			"label": "Disease",
			"description": "name of the disease",
			"type": "string",
			"example": "COVID-19",
			"required": true
		},
		"location": {
			"label": "Location",
			"description": "location of the outbreak the chart is showing",
			"type": "string",
			"example": "the United States",
			"required": true
		},
		"location2": {
			"label": "Location 2",
			"description": "broader location such as state/province or country",
			"type": "string",
			"example": "Maharashtra"
		},
		"location3": {
			"label": "Location 3",
			"description": "broadest location such as country",
			"type": "string",
			"example": "India"
		},
		"posttitle": {
			"label": "Post-title",
			"description": "text at the end of the title",
			"type": "string",
			"example": "(including Greenland and the Faroe Islands)"
		},
		"outbreak": {
			"label": "Outbreak",
			"description": "name of the main outbreak for the links of the ",
			"type": "string",
			"example": "COVID-19 pandemic",
			"required": true
		},
		"recoveries": {
			"label": "Recoveries",
			"description": "whether to display recoveries in the legend (yesno)",
			"default": "yes",
			"autovalue": "n"
		},
		"reclbl": {
			"label": "Recoveries label",
			"description": "alternate label for the recoveries classification",
			"type": "string",
			"default": "Recoveries"
		},
		"altlbl1": {
			"label": "Alternate label 1",
			"description": "alternate label for the third cases classification (hide)",
			"type": "string",
			"default": "Active cases",
			"example": "hide"
		},
		"altlbl2": {
			"label": "Alternate label 2",
			"description": "alternate label for the fourth cases classification",
			"type": "string",
			"example": "Clinically diagnosed (C.D.)"
		},
		"altlbl3": {
			"label": "Alternate label 3",
			"description": "alternate label for the fifth cases classification",
			"type": "string",
			"example": "Tested or C.D."
		},
		"right1": {
			"label": "Right 1",
			"description": "heading of the first data column",
			"type": "string",
			"default": "# of cases"
		},
		"right2": {
			"label": "Right 2",
			"description": "heading of the second data column",
			"type": "string",
			"autovalue": "# of deaths"
		},
		"data": {
			"label": "Data",
			"description": "data lines for each valid date or interval (see Data's syntax)",
			"type": "content",
			"example": "2009-04-13;;;42;;;42;firstright1=y\n2009-04-14;;;356;;;356;+748%\n2009-04-15;;;1503;;;1,503;+322%",
			"suggested": true
		},
		"collapsible": {
			"label": "Collapsible",
			"description": "whether the rows are collapsible (forced \"no\" if the days span