Interface FillValueContextIf

What an own fill function (FillHandleOptionsIf.fillValue) gets for each filled cell.

Example

const weekdays = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
const fillValue = (ctx: FillValueContextIf) => {
const last = ctx.sourceValues[ctx.sourceValues.length - 1];
const i = weekdays.indexOf(String(last));
return i < 0 || ctx.copy ? undefined : weekdays[(((i + ctx.step) % 7) + 7) % 7]; // undefined = default
};

Since

1.1.96

Hierarchy

  • FillValueContextIf

Properties

columnIndex: number

Model index of the filled cell's column.

copy: boolean

true if the values are copied (⌥/Alt on a series, Ctrl/⌘+D, Ctrl/⌘+R).

defaultValue: unknown

The value the table would use (series or copy).

direction: FillDirection

The direction of the fill.

property: string

The property of the column ("" without a column definition).

row: unknown

The row object of the filled cell (undefined for own area models without row objects).

rowIndex: number

Display index of the filled cell's row.

sourceValues: unknown[]

The values of the source line (the column when filling down/up, the row when filling right/left), as shown.

step: number

1, 2, 3 … after the source (down/right), −1, −2 … in front of it (up/left).