Reflex Logo

Intro

Gallery

Hosting

Components

New

Learn

Components

API Reference

Onboarding

Library

/

Graphing

/

Label

rx.recharts.labeland rx.recharts.label_list add in labels to the graphs. rx.recharts.label_list takes in a data_key where we define the data column to plot.

rx.recharts.bar_chart(
    rx.recharts.bar(
        rx.recharts.label_list(
            data_key="uv", position="top"
        ),
        data_key="uv",
        stroke="#8884d8",
        fill="#8884d8",
    ),
    rx.recharts.bar(
        rx.recharts.label_list(
            data_key="pv", position="top"
        ),
        data_key="pv",
        stroke="#82ca9d",
        fill="#82ca9d",
    ),
    rx.recharts.x_axis(data_key="name"),
    rx.recharts.y_axis(),
    margin={
        "left": 10,
        "right": 0,
        "top": 20,
        "bottom": 10,
    },
    data=data,
)

A Label component in Recharts.

PropTypeDescriptionValues
view_boxDict

The box of viewing area, which has the shape of {x: someVal, y: someVal, width: someVal, height: someVal}, usually calculated internally.

valuestr

The value of label, which can be specified by this props or the children of

offsetint

The offset of label which can be specified by this props or the children of

positionLiteral

The position of label which can be specified by this props or the children of

Event Triggers

No component specific event triggers

A LabelList component in Recharts.

PropTypeDescriptionValues
data_keyUnion

The key of a group of label values in data.

positionLiteral

The position of each label relative to it view box。"Top" | "left" | "right" | "bottom" | "inside" | "outside" | "insideLeft" | "insideRight" | "insideTop" | "insideBottom" | "insideTopLeft" | "insideBottomLeft" | "insideTopRight" | "insideBottomRight" | "insideStart" | "insideEnd" | "end" | "center"

offsetint

The offset to the specified "position"

fillstr

Color of the fill

strokestr

Color of the stroke

Event Triggers

No component specific event triggers

← FunnelchartLegend →

Did you find this useful?