RedcrabX – Chart Input Guide
Reference for expression syntax in the Chart Box | All chart types | Version 1.0
Table of Contents
- 1. General Syntax Rules
- 2. Single-Series Charts (Column, Bar, Line, Spline, Area, StepLine, QuickLine, Point, Scatter)
- 3. Stacked Charts (StackedColumn, StackedBar, StackedArea)
- 4. Circular / Proportion Charts (Pie, Doughnut, Pyramid, StreamLineFunnel, SectionFunnel)
- 5. Bubble Chart
- 6. Financial Charts (CandleStick, Stock)
- 7. Radial Charts (Radar, Polar)
- 8. Working with Matrices
- 9. Advanced Syntax Reference
- 10. Complete Examples
1. General Syntax Rules
The Expression field accepts one or more array expressions separated by ;.
Each expression resolves to a list of numbers (a series).
The optional X-Variable field defines the values for the X-axis.
| Concept | Syntax | Description |
|---|---|---|
| Single series | A | Variable A (must be a 1D array) |
| Multiple series | A; B; C | Semicolon separates series |
| Series group | [A, B, C] | Shorthand for A; B; C |
| Named series | Revenue = A | Legend shows "Revenue" instead of "A" |
| Inline range | [1..10] | Array 1, 2, … 10 |
| Range with step | [0..1:0.1] | Array 0.0, 0.1, … 1.0 |
| Inline array | [10, 20, 35, 18] | Literal value list |
| Matrix columns | cols(M) | Each column of matrix M as a separate series |
| Matrix rows | rows(M) | Each row of matrix M as a separate series |
| Inline XY group | {x: T, y: [A,B]} | Define X and Y expressions together |
| Color override | Colors field: #ff0000; #00aa00; blue | One color per series, separated by ; |
A = [1..12] in a calculator box, then use A in the chart expression.
2. Single-Series Charts
Applies to: Column Bar Line Spline Area StepLine QuickLine Point
| Field | What to enter |
|---|---|
| Expression | One or more 1D arrays, separated by ; |
| X-Variable (optional) | A 1D array of the same length for custom X labels/positions |
Examples
Expression: [10, 20, 35, 18, 42]
Expression: Sales; Costs; Profit
X-Variable: Month ← array: [1..12]
Expression: [Sales, Costs, Profit] ← same result as above
Expression: Revenue = Sales; Expense = Costs ← named legend entries
Expression: {x: Month, y: [Sales, Costs]} ← inline XY syntax
3. Stacked Charts
Applies to: StackedColumn StackedBar StackedArea
Identical input rules to single-series charts. Provide two or more series — they are stacked automatically.
Expression: ProductA; ProductB; ProductC X-Variable: Quarter ← e.g. [1..4]
4. Circular / Proportion Charts
Applies to: Pie Doughnut Pyramid StreamLineFunnel SectionFunnel
| Field | What to enter |
|---|---|
| Expression | A single 1D array – each value becomes one slice / segment |
| X-Variable | Optional: array of labels shown per slice (must match length) |
Expression: [35, 28, 19, 18] X-Variable: ← leave empty, or use a label array Expression: MarketShare ← variable with 4+ values
5. Bubble Chart
Bubble
Bubble charts require three values per data point: X position, Y position, and bubble size (Z). Use a matrix with 3 columns.
| Column index | Meaning |
|---|---|
| 0 | X position (replaces the X-Variable field) |
| 1 | Y value (height) |
| 2 | Bubble size (Z value) |
← Define a 3-column matrix in a calculator box:
BubbleData = [1,10,5; 2,30,15; 3,20,8; 4,40,25; 5,15,10]
← Then use cols() to feed the three series:
Expression: cols(BubbleData)
← Alternative: three separate variables
X = [1,2,3,4,5]
Y = [10,30,20,40,15]
Z = [5,15,8,25,10]
Expression: {x: X, y: [Y, Z]}
6. Financial Charts – CandleStick & Stock
CandleStick Stock
These chart types require four values per data point in a fixed order: High, Low, Open, Close.
Option A – Matrix (recommended)
Define an n × 4 matrix where each row is one candle (time period).
← In a calculator box:
Candles = [110,95,100,108;
120,100,105,118;
115,98,102,110;
125,112,111,120]
↑ ↑ ↑ ↑
High Low Open Close
← In the chart Expression field:
Expression: Candles
← Optional custom X labels:
X-Variable: Days ← e.g. Days = [1..4]
Option B – Explicit ohlc() function
Define four separate arrays of equal length and combine them with ohlc().
← In calculator boxes: H = [110, 120, 115, 125] L = [95, 100, 98, 112] O = [100, 105, 102, 111] C = [108, 118, 110, 120] ← In the chart Expression field: Expression: ohlc(H, L, O, C)
Option C – rows() explicit notation
Expression: rows(Candles) ← same as just "Candles" for n×4 matrices
| Syntax | Requirement |
|---|---|
MatrixName | Matrix with exactly 4 columns (n rows = n candles) |
ohlc(H, L, O, C) | Four 1D arrays of equal length |
rows(M) | Same as bare matrix name (n×4) |
7. Radial Charts – Radar & Polar
Radar Polar
Radar and Polar charts display one or more data series around a circular axis. Input follows the same rules as standard single-series charts.
| Field | What to enter |
|---|---|
| Expression | One or more 1D arrays, separated by ; |
| X-Variable (optional) | Array of axis labels (category names per spoke) |
← Spider / skills chart Skills = [85, 70, 90, 60, 75, 80] Baseline = [70, 70, 70, 70, 70, 70] Expression: Skills; Baseline ← With custom spoke labels (set in X-Variable field): Labels = ← not yet supported as string labels; use numeric indices
8. Working with Matrices
Matrices are stored as row-major flat arrays. Define them in a calculator box using
;-separated rows and ,-separated cells.
M = [1,2,3; 4,5,6; 7,8,9] ← 3×3 matrix cols(M) → three series: [1,4,7], [2,5,8], [3,6,9] (columns) rows(M) → three series: [1,2,3], [4,5,6], [7,8,9] (rows) M → auto-expanded to columns (same as cols(M))
You can also build a matrix from 1D arrays (in a calculator box):
A = [1..5] B = [6..10] C = [11..15] Grid = [A, B, C] ← 3×5 matrix (one array per row)
9. Advanced Syntax Reference
| Syntax | Where | Effect |
|---|---|---|
name = expr | Expression field | Assigns a legend label to a series |
[A, B, C] | Expression field | Expands to three separate series |
[1..N] | Expression or calculator | Integer range 1 to N |
[start..end:step] | Expression or calculator | Floating-point range with step |
cols(M) | Expression field | Matrix columns as series |
rows(M) | Expression field | Matrix rows as series |
ohlc(H,L,O,C) | Expression field (OHLC only) | Financial candle from 4 arrays |
{x: xExpr, y: yExpr} | Expression field | Inline X+Y specification |
{x: T, y: [A,B,C]} | Expression field | Custom X axis + multiple Y series |
Toolbar Buttons
| Button | Action |
|---|---|
| Legend icon | Toggle chart legend on/off |
| Grid icon | Toggle Y-axis gridlines on/off |
| Marker icon | Toggle data-point markers on/off (line charts) |
| 3D icon | Toggle 3D rendering on/off |
| Export icon | Export chart as JPEG or BMP image |
10. Complete Examples
Line chart – sine wave
← Calculator boxes: T = [0..6.28:0.1] Sine = sin(T) Cosine= cos(T) ← ChartBox settings: Chart Type: Line Expression: Sine = sin(T); Cosine = cos(T) X-Variable: T Title: Trigonometric Functions Y-Label: Amplitude
Column chart – monthly sales with three products
← Calculator boxes: Month = [1..12] PA = [12,15,18,22,19,25,30,28,21,17,14,20] PB = [8,10,12,14,11,16,19,17,13,11,9,12] PC = [5,6,7,9,8,10,12,11,9,7,6,8] ← ChartBox settings: Chart Type: Column Expression: Product_A = PA; Product_B = PB; Product_C = PC X-Variable: Month
CandleStick chart – 5 trading days
← Calculator box:
Prices = [108,101,103,107;
112,106,107,110;
110,104,110,105;
115,108,105,114;
113,109,114,111]
← ChartBox settings:
Chart Type: CandleStick
Expression: Prices
X-Variable: ← leave empty (uses index 0–4)
Title: 5-Day Price Chart
Y-Label: Price (USD)
Pie chart – market share
← Calculator box: Share = [38, 27, 19, 16] ← ChartBox settings: Chart Type: Pie Expression: Share Colors: #2196F3; #FF5722; #4CAF50; #9C27B0
Radar chart – product comparison
← Calculator boxes: ModelA = [85, 70, 90, 60, 75] ModelB = [65, 85, 75, 80, 70] ← ChartBox settings: Chart Type: Radar Expression: Model_A = ModelA; Model_B = ModelB
calcX Chart Input Guide · Generated automatically · For Visifire WPF Charts on .NET 10