✨ Announcing our seed funding led by Lux Capital! Read more about it on our blog
DocsBlogChangelog

Search documentation...

/

Star

12k+

[ Learn ]

[ Concepts ]

[ Reference ]

ErrorBar


ErrorBar is a wrapper component that renders a error bar graph.

Data


ErrorBar accepts a data prop, which is an array of dictionaries with x, y, error_x, and error_y keys. You can contruct your own data as input, or use the rx.data helper function to generate a data array from a x, y, error_x, and error_y list.
data = rx.data(
    "error_bar",
    x=[1, 2, 3, 4, 5],
    y=[1, 2, 3, 4, 10],
    error_x=[0.1, 0.2, 0.3, 0.4, 0.5],
    error_y=[0.1, 0.2, 0.3, 0.4, 0.5],
)
Which will render as:
data = [
    {"x": 1, "y": 1, "error_x": 0.1, "error_y": 0.1},
    {"x": 2, "y": 2, "error_x": 0.2, "error_y": 0.2},
    {"x": 3, "y": 3, "error_x": 0.3, "error_y": 0.3},
    {"x": 4, "y": 4, "error_x": 0.4, "error_y": 0.4},
    {"x": 5, "y": 10, "error_x": 0.5, "error_y": 0.5},
]

Examples


The following example shows a basic rx.error_bar component.
1.02.03.04.05.0246810
rx.chart(
    rx.error_bar(
        data=rx.data(
            "error_bar",
            x=[1, 2, 3, 4, 5],
            y=[1, 2, 3, 4, 10],
            error_x=[0.1, 0.2, 0.3, 0.4, 0.5],
            error_y=[0.1, 0.2, 0.3, 0.4, 0.5],
        ),
    ),
)

ErrorBar


Display a victory errorbar.


  • Base Event Triggers

← CandlestickLine →

Copyright © 2023 Pynecone, Inc.