Enumeration FormatType

Format type, used in the Slot.format function. A value can be formatted for use as a 'label' or as 'data'. A host application is allowed to provide different formatting rules for both types. For instance, the value in a tooltip might have different formatting applied that same value on an axis.

Index

Enumeration members

Enumeration members

data

data: = "data"

Format the value for use as a data item (e.g. in a tooltip).

label

label: = "label"

Format the value for use as a label (e.g. on an axis).

const slot = _info.data.slotMap.get( "values" );
const axis = d3.axisLeft( scale ).tickFormat( v =>
{
    // Format the axis value using the formatter of the slot.
    return slot.format( v.valueOf(), FormatType.label );
} );