LabelList

Parent Components

LabelList consumes context provided by these components:

Properties

  • dataKeyString | Number | Function

    Decides how to extract the value of each label from the data: - `string`: the name of the field in the data object; - `number`: the index of the field in the data; - `function`: a function that receives the data object and returns the value of each label. If set, then valueAccessor will be ignored. Scatter requires this prop to be set. Other graphical components will show the same value as the dataKey of the component by default.

  • valueAccessorFunctionoptional

    The accessor function to get the value of each label. Is ignored if dataKey is specified.

  • contentReactElement | Functionoptional

    If set a React element, the option is the customized React element of rendering each label. If set a function, the function will be called to render each label content.

    FORMAT:

    <LabelList content={<CustomizedLabel external={external} />} />
    <LabelList content={renderLabel} />
  • position"top" | "left" | "right" | "bottom" | "inside" | "outside" | "insideLeft" | "insideRight" | "insideTop" | "insideBottom" | "insideTopLeft" | "insideBottomLeft" | "insideTopRight" | "insideBottomRight" | "insideStart" | "insideEnd" | "end" | "center"optional

    The position of label relative to the view box.

  • offsetNumber

    The offset to the specified "position". Direction of the offset depends on the position.

    DEFAULT: 5

  • angleNumberoptional

    Text rotation angle in degrees. The text will be rotated around the (x, y) coordinates as the pivot point. Positive values rotate clockwise, negative values rotate counterclockwise.

    DEFAULT: 0

  • formatterFunctionoptional

    The formatter function of label value which has only one parameter - the value of label.

  • clockWisebooleanoptional

    The parameter to calculate the view box of label in radial charts.

    DEFAULT: false

  • idStringoptional

    The unique id of this component, which will be used to generate unique clip path id internally. This props is suggested to be set in SSR.