CHART
Charts computed by the engine and drawn with Vega-Lite: bar, line, area, pie, scatter, histogram, boxplot, error bar, pyramid, high-low, dual-axis, violin, heat map, Q-Q, P-P, and rotatable 3-D scatter and bar charts.
Syntax
Section titled “Syntax”CHART type(stat var | x WITH y | MATRIX varlist | x WITH y WITH z) [BY category] [BY group] [/ERRORBAR=CI(95)|SE(n)|SD(n)] [/FIT=LINEAR|QUADRATIC|CUBIC|LOESS] [/NORMAL] [/BINS=n] [/STACKED] [/VIEW=AZIMUTH(deg) ELEVATION(deg)] [/TITLE='…'] [/SUBTITLE='…'] [/TEMPLATE=DEFAULT|MONO] [/MISSING=INCLUDE].Synopsis
Section titled “Synopsis”| Kind | Procedure (reads data, produces output) |
| Body | main /SUBCOMMAND[=] … |
| Changes data | no |
| Subcommands | /BINS, /DIST, /ERRORBAR, /FIT, /MISSING, /NORMAL, /STACKED, /SUBTITLE, /TEMPLATE, /TITLE, /VIEW |
| Menu | Analyze ▸ Graphs |
| Slot: Variables | 0+ variable(s); levels: nominal, ordinal, scale; types: numeric, string |
Specifications
Section titled “Specifications”- VIEW: 3-D charts only: the viewing angle used for exports and the starting angle in the app, AZIMUTH (degrees around the vertical axis, default 35) and ELEVATION (−10 to 90, default 20).
Examples
Section titled “Examples”CHART BAR(MEAN nps) BY region /ERRORBAR=CI(95) /TITLE='NPS by region'.CHART SCATTER(age WITH income) BY gender /FIT=LOESS.CHART HISTOGRAM(income) /NORMAL.CHART SCATTER3D(age WITH income WITH nps) BY gender /VIEW=AZIMUTH(-30) ELEVATION(30).CHART BAR3D(MEAN income) BY region BY satisfaction.- Scatter plots with more than 10,000 points draw a fixed random sample, so the same data always gives the same picture.
- SCATTER3D draws at most 2,000 points (a fixed random sample beyond that). BAR3D needs two BY variables: across, then depth. In the app 3-D charts rotate with the mouse or arrow keys; exports show the /VIEW angle.
- SPSS and PSPP GRAPH syntax converts to CHART (bar, line, area, pie, high-low, error bar, scatterplot including XYZ, histogram).
- Under SPLIT FILE LAYERED a chart has one panel per group, with shared axes so groups compare directly; under SPLIT FILE SEPARATE each group gets its own chart. Violin plots and scatterplot matrices already use panels, so they stay one chart per group.
Related
Section titled “Related”OUTPUT EXPORT, EXAMINE, SPLIT FILE
Generated from OrcStat’s command registry and reference. To suggest a change, open an issue.