Կաղապար:Graph:Chart
Jump to navigation
Jump to search
Կաղապարի նկարագրություն
![]() | Օգտագործում է Lua: |
Parameters
- width: width of the chart
- height: height of the chart
- type: type of the chart: line for line charts, area for area charts, and rect for (column) bar charts. Multiple series can stacked using the stacked prefix, e.g. stackedarea.
- interpolate: interpolation method for line and area charts. It is recommended to use monotone for a monotone cubic interpolation – further supported values are listed at https://github.com/trifacta/vega/wiki/Marks#area.
- colors: color palette of the chart as a comma-separated list of colors. The color values must be given either as #rgb/#rrggbb/#aarrggbb or by a CSS color name. For #aarrggbb the aa component denotes the alpha channel, i.e. FF=100% opacity, 80=50% opacity/transparency, etc. (The default color palette is category10).
- 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
- xAxisFormat and yAxisFormat: changes the formatting of the axis labels. Supported values are listed at https://github.com/mbostock/d3/wiki/Formatting. For example, the format d can be used to suppress the separators for year numbers.
- x: the x-values as a comma-separated list
- y or y1, y2, …: the y-values for one or several data series, respectively
- legend: show legend (only works in case of multiple data series)
- y1Title, y2Title, …: defines the label of the respective data series in the legend
Note: In the editor preview the graph extension creates a canvas element with vector graphics. However, when saving the page a PNG raster graphics is generated instead.
Examples
Line Chart:
Note: The y-axis starts from the smallest y value, though this can be overridden with the yAxisMin parameter.
Area chart:
Note: The y-axis starts from zero
Bar chart:
Line chart with more than one data series, using colors:
Area chart with more than one data series showing blended overlap:
Bar chart with multiple data series:
Area chart with smoothed data values:
Bar chart with stacked data series: