installation
state
1
2
3
4
5
6
7
8
9
10
11
12
13
import reflex as rx

class State(rx.State):

    data = [
        {"month": "Jan", "desktop": 186},
        {"month": "Feb", "desktop": 305},
        {"month": "Mar", "desktop": 237},
        {"month": "Apr", "desktop": 73},
        {"month": "May", "desktop": 209},
        {"month": "Jun", "desktop": 214},
    ]
                            
7areabarlinepiedoughnutradarscatter
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from .state import State
                            
def area_chart():
    return rx.recharts.area_chart(
        rx.recharts.area(
            data_key="desktop",
            fill=rx.color("accent"),
            stroke=rx.color("accent", 8),
        ),
        data=State.data,
        width="100%",
        height=250,
    )
                            
1
2
3
4
5
rx.recharts.cartesian_grid(
    horizontal=True, 
    vertical=False, 
    class_name="opacity-25"
)
1
2
3
4
5
6
7
8
rx.recharts.x_axis(
    data_key="month",
    axis_line=False,
    tick_size=10,
    tick_line=False,
    custom_attrs={"fontSize": "12px"},
    interval="preserveStartEnd",
)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
tooltip_styles = {
    "is_animation_active": False,
    "separator": "",
    "cursor": False,
    "item_style": {
        "color": "currentColor",
        "display": "flex",
        "paddingBottom": "0px",
        "justifyContent": "space-between",
        "textTransform": "capitalize",
    },
    "label_style": {
        "color": rx.color("slate", 9),
        "fontWeight": "500",
    },
    "content_style": {
        "background": rx.color("slate", 1),
        "borderColor": rx.color("slate", 5),
        "borderRadius": "5px",
        "fontFamily": "var(--font-instrument-sans)",
        "fontSize": "0.875rem",
        "lineHeight": "1.25rem",
        "fontWeight": "500",
        "letterSpacing": "-0.01rem",
        "minWidth": "8rem",
        "width": "175px",
        "padding": "0.375rem 0.625rem ",
        "position": "relative",
    },
    "general_style": "[&_.recharts-tooltip-item-separator]:w-full",
}

Home