Module:Graph/doc: Difference between revisions

Content deleted Content added
Pietrasagh (talk | contribs)
m corrected dead link
Pietrasagh (talk | contribs)
No edit summary
Line 40:
* '''xAxisTitle''' and '''yAxisTitle''': captions of the x and y axes
* '''xAxisMin''', '''xAxisMax''', '''yAxisMin''', and '''yAxisMax''': minimum and maximum values of the x and y axes (not yet supported for bar charts). These parameters can be used to invert the scale of a numeric axis by setting the lowest value to the Max and highest value to the Min.
* '''xAxisFormat''' and '''yAxisFormat''': changes the formatting of the axis labels. Supported values are listed at https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#numbers for numbers. For example, the format <code>%</code> can be used to output percentages. For date/time specification of supported values is and https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md for, date/timee.g. For example, the format <code>xAxisFormat=%d-%m-%Y</code> canfor beresult used13-01-1977. to output percentages.
* '''xAxisAngle''': rotates the x axis labels by the specified angle. Recommended values are: -45, +45, -90, +90
* '''xType''' and '''yType''': data types of the values, e.g. <code>integer</code> for integers, <code>number</code> for real numbers, <code>date</code> for dates (e.g. YYYY/-MM/-DD), and <code>string</code> for ordinal values (use <code>string</code> to prevent axis values from being repeated when there are only a few values). Remarks: <code>Date</code> type doesn't work for bar graphs. For <code>date</code> data input please use ISO date format (e.g. YYYY-MM-DD) acc. to [https://developer.mozilla.org/en-US/docs/Web/HTML/Date_and_time_formats date and time formats used in HTML]. Other date format may work but not in all browsers. Date is unfortunately displayed only in en-US format for all Wikipedia languages. Workaround is to use '''xAxisFormat''' and '''yAxisFormat''' with numerical dates format.
* '''xScaleType''' and '''yScaleType''': scale types of the x and y axes, e.g. <code>linear</code> for linear scale (default), <code>log</code> for logarithmic scale and <code>sqrt</code> for square root scale.
* '''x''': the x-values as a comma-separated list, for dates and time see remark in '''xType''' and '''yType'''
* '''y''' or '''y1''', '''y2''', …: the y-values for one or several data series, respectively. For pie charts <code>y2</code> denotes the radiusesradius of the corresponding sectors. For dates and time see remark in '''xType''' and '''yType'''
* '''legend''': show legend (only works in case of multiple data series)
* '''y1Title''', '''y2Title''', …: defines the label of the respective data series in the legend