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

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.

ConceptSyntaxDescription
Single seriesAVariable A (must be a 1D array)
Multiple seriesA; B; CSemicolon separates series
Series group[A, B, C]Shorthand for A; B; C
Named seriesRevenue = ALegend 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 columnscols(M)Each column of matrix M as a separate series
Matrix rowsrows(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 overrideColors field: #ff0000; #00aa00; blueOne color per series, separated by ;
Tip: Variables are defined in the Calculator (MathBox) boxes above the chart. Example: type 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

FieldWhat to enter
ExpressionOne 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
Line / Spline / QuickLine / StepLine: Use the Marker button in the toolbar to toggle data-point markers on/off. Markers are off by default to keep lines clean.

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

FieldWhat to enter
ExpressionA single 1D array – each value becomes one slice / segment
X-VariableOptional: array of labels shown per slice (must match length)
Note: Axes are hidden automatically for these chart types. The Grid and 3D buttons have no visual effect here. Multiple series expressions are accepted but only the first is rendered.
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 indexMeaning
0X position (replaces the X-Variable field)
1Y value (height)
2Bubble 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]}
Note: Visifire interprets the second series as the Z (size) data when the chart type is Bubble.

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
SyntaxRequirement
MatrixNameMatrix 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.

FieldWhat to enter
ExpressionOne 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
Note: Axes are hidden automatically. The Grid button has no effect. Use 3–12 equally spaced values for best visual results.

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

SyntaxWhereEffect
name = exprExpression fieldAssigns a legend label to a series
[A, B, C]Expression fieldExpands to three separate series
[1..N]Expression or calculatorInteger range 1 to N
[start..end:step]Expression or calculatorFloating-point range with step
cols(M)Expression fieldMatrix columns as series
rows(M)Expression fieldMatrix rows as series
ohlc(H,L,O,C)Expression field (OHLC only)Financial candle from 4 arrays
{x: xExpr, y: yExpr}Expression fieldInline X+Y specification
{x: T, y: [A,B,C]}Expression fieldCustom X axis + multiple Y series

Toolbar Buttons

ButtonAction
Legend iconToggle chart legend on/off
Grid iconToggle Y-axis gridlines on/off
Marker iconToggle data-point markers on/off (line charts)
3D iconToggle 3D rendering on/off
Export iconExport 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