chart class
Displays data sets in a chart or a group of charts.
Methods¶
__init__() ¶
__init__(
data=None,
type="scatter",
mode="lines+markers",
x=None,
y=None,
z=None,
lon=None,
lat=None,
r=None,
theta=None,
high=None,
low=None,
open=None,
close=None,
measure=None,
locations=None,
values=None,
labels=None,
parents=None,
text=None,
base=None,
title=None,
render=True,
on_range_change=None,
columns=None, # All columns
label=None,
name=None,
selected=None,
color=None,
selected_color=None,
marker=None,
line=None,
selected_marker=None,
layout=None,
plot_config=None,
options=None,
orientation=None,
text_anchor=None,
xaxis=None,
yaxis=None,
width="100%",
height=None,
template=None,
decimator=None,
rebuild=False,
figure=None,
on_click=None,
on_change=None,
propagate=None, # App config
active=True,
id=None,
properties=None,
class_name=None,
hover_text=None,
) -> None
Create a new chart element.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
dynamic(Any)
|
The data object bound to this chart control. |
None
|
type
|
indexed(str)
|
Chart type. |
scatter
|
mode
|
indexed(str)
|
Chart mode. |
lines+markers
|
x
|
indexed(str)
|
Column name for the x axis. |
None
|
y
|
indexed(str)
|
Column name for the y axis. |
None
|
z
|
indexed(str)
|
Column name for the z axis. |
None
|
lon
|
indexed(str)
|
Column name for the longitude value, for 'scattergeo' charts. See Plotly Map traces. |
None
|
lat
|
indexed(str)
|
Column name for the latitude value, for 'scattergeo' charts. See Plotly Map traces. |
None
|
r
|
indexed(str)
|
Column name for the r value, for 'scatterpolar' charts. See Plotly Polar charts. |
None
|
theta
|
indexed(str)
|
Column name for the theta value, for 'scatterpolar' charts. See Plotly Polar charts. |
None
|
high
|
indexed(str)
|
Column name for the high value, for 'candlestick' charts. See Plotly Candlestick charts. |
None
|
low
|
indexed(str)
|
Column name for the low value, for 'candlestick' charts. See Ploty Candlestick charts. |
None
|
open
|
indexed(str)
|
Column name for the open value, for 'candlestick' charts. See Plotly Candlestick charts. |
None
|
close
|
indexed(str)
|
Column name for the close value, for 'candlestick' charts. See Plotly Candlestick charts. |
None
|
measure
|
indexed(str)
|
Column name for the measure value, for 'waterfall' charts. See Plotly Waterfall charts. |
None
|
locations
|
indexed(str)
|
Column name for the locations value. See Plotly Choropleth maps. |
None
|
values
|
indexed(str)
|
Column name for the values value. See Plotly Pie charts or Plotly Funnel Area charts. |
None
|
labels
|
indexed(str)
|
Column name for the labels value. See Plotly Pie charts. |
None
|
parents
|
indexed(str)
|
Column name for the parents value. See Plotly Treemap charts. |
None
|
text
|
indexed(str)
|
Column name for the text associated to the point for the indicated trace. |
None
|
base
|
indexed(str)
|
Column name for the base value. Used in bar charts only. |
None
|
title
|
str
|
The title of the chart control. |
None
|
render
|
dynamic(bool)
|
If True, this chart is visible on the page. |
True
|
on_range_change
|
Union[str, Callable]
|
A function or the name of a function that is triggered when the visible part of the x axis changes. |
None
|
columns
|
Union[str, list[str], dict[str, dict[str, str]]]
|
The list of column names to represent.
If columns is omitted or set to None, all columns of data are represented. |
All columns
|
label
|
indexed(str)
|
The label for the indicated trace. |
None
|
name
|
indexed(str)
|
The name of the indicated trace. |
None
|
selected
|
indexed(dynamic(Union[list[int], str]))
|
The list of the indices of the rows to be displayed as selected. |
None
|
color
|
indexed(str)
|
The color of the indicated trace (or a column name for scattered). |
None
|
selected_color
|
indexed(str)
|
The color of the selected points for the indicated trace. |
None
|
marker
|
indexed(dict[str, Any])
|
The type of markers used for the indicated trace. |
None
|
line
|
indexed(Union[str, dict[str, Any]])
|
The configuration of the line used for the indicated trace. |
None
|
selected_marker
|
indexed(dict[str, Any])
|
The type of markers used for selected points in the indicated trace. |
None
|
layout
|
dynamic(dict[str, Any])
|
The plotly.js compatible layout object. |
None
|
plot_config
|
dict[str, Any]
|
The plotly.js compatible configuration options object. |
None
|
options
|
indexed(dict[str, Any])
|
The plotly.js compatible data object where dynamic data will be overridden.. |
None
|
orientation
|
indexed(str)
|
The orientation of the indicated trace. |
None
|
text_anchor
|
indexed(str)
|
Position of the text relative to the point. |
None
|
xaxis
|
indexed(str)
|
The x axis identifier for the indicated trace. |
None
|
yaxis
|
indexed(str)
|
The y axis identifier for the indicated trace. |
None
|
width
|
Union[str, int, float]
|
The width of the chart, in CSS units. |
100%
|
height
|
Union[str, int, float]
|
The height of the chart, in CSS units. |
None
|
template
|
dict
|
The Plotly layout template. |
None
|
decimator
|
indexed(str)
|
The name of the Python variable that holds a decimator instance for the indicated trace. |
None
|
rebuild
|
dynamic(bool)
|
Allows dynamic config refresh if set to True. |
False
|
figure
|
dynamic(Figure)
|
A figure as produced by Plotly. |
None
|
on_click
|
Union[str, Callable]
|
A function or the name of a function that is triggered when the user clicks in the chart background.
|
None
|
on_change
|
Union[str, Callable]
|
A function or the name of a function that is triggered when the value changes.
|
None
|
propagate
|
bool
|
Determines whether the control's value is automatically reflected in the bound application variable. |
App config
|
active
|
dynamic(bool)
|
Indicates if this element is active. |
True
|
id
|
str
|
The identifier assigned to the rendered HTML component. |
None
|
properties
|
dict[str, Any]
|
A dictionary of additional properties that can be set to the element. |
None
|
class_name
|
dynamic(str)
|
A space-separated list of CSS class names to be applied to the generated HTML element. |
None
|
hover_text
|
dynamic(str)
|
The text that is displayed when the user hovers over the element. |
None
|