Skip to content

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

Any
dynamic

The data object bound to this chart control.
See the section on the data property below for more details.

None

type

str
indexed

Chart type.
See the Plotly chart type documentation for more details.

scatter

mode

str
indexed

Chart mode.
See the Plotly chart mode documentation for more details.

lines+markers

x

str
indexed

Column name for the x axis.

None

y

str
indexed

Column name for the y axis.

None

z

str
indexed

Column name for the z axis.

None

lon

str
indexed

Column name for the longitude value, for 'scattergeo' charts. See Plotly Map traces.

None

lat

str
indexed

Column name for the latitude value, for 'scattergeo' charts. See Plotly Map traces.

None

r

str
indexed

Column name for the r value, for 'scatterpolar' charts. See Plotly Polar charts.

None

theta

str
indexed

Column name for the theta value, for 'scatterpolar' charts. See Plotly Polar charts.

None

high

str
indexed

Column name for the high value, for 'candlestick' charts. See Plotly Candlestick charts.

None

low

str
indexed

Column name for the low value, for 'candlestick' charts. See Ploty Candlestick charts.

None

open

str
indexed

Column name for the open value, for 'candlestick' charts. See Plotly Candlestick charts.

None

close

str
indexed

Column name for the close value, for 'candlestick' charts. See Plotly Candlestick charts.

None

measure

str
indexed

Column name for the measure value, for 'waterfall' charts. See Plotly Waterfall charts.

None

locations

str
indexed

Column name for the locations value. See Plotly Choropleth maps.

None

values

str
indexed

Column name for the values value. See Plotly Pie charts or Plotly Funnel Area charts.

None

labels

str
indexed

Column name for the labels value. See Plotly Pie charts.

None

parents

str
indexed

Column name for the parents value. See Plotly Treemap charts.

None

text

str
indexed

Column name for the text associated to the point for the indicated trace.
This is meaningful only when mode has the text option.

None

base

str
indexed

Column name for the base value. Used in bar charts only.
See the Plotly bar chart base documentation for more details."

None

title

str

The title of this chart control.

None

render

bool
dynamic

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.
This function is invoked with the following parameters:

  • state (State): the state instance.
  • id (str): the identifier of the chart control if it has one.
  • payload (dict[str, Any]): the full details on this callback's invocation, as emitted by Plotly.
None

columns

Union[str, list[str], dict[str, dict[str, str]]]

The list of column names to represent.

  • str: ;-separated list of column names
  • list[str]: list of names
  • dict: {"column_name": {format: "format", index: 1}} if index is specified, it represents the display order of the columns. If not, the list order defines the index

If columns is omitted or set to None, all columns of data are represented.


All columns

label

str
indexed

The label for the indicated trace.
This is used when the mouse hovers over a trace.

None

name

str
indexed

The name of the indicated trace.

None

selected

Union[list[int],str]
indexed
dynamic

The list of the selected point indices .

None

color

str
indexed

The color of the indicated trace (or a column name for scattered).

None

selected_color

str
indexed

The color of the selected points for the indicated trace.

None

marker

dict[str, Any]
indexed

The type of markers used for the indicated trace.
See marker for more details.
Color, opacity, size and symbol can be column names.

None

line

Union[str,dict[str,Any]]
indexed

The configuration of the line used for the indicated trace.
See line for more details.
If the value is a string, it must be a dash type or pattern (see dash style of lines for more details).

None

selected_marker

dict[str, Any]
indexed

The type of markers used for selected points in the indicated trace.
See selected marker for more details.

None

layout

dict[str, Any]
dynamic

The plotly.js compatible layout object.

None

plot_config

dict[str, Any]

The plotly.js compatible configuration options object.

None

options

dict[str, Any]
indexed
None

orientation

str
indexed

The orientation of the indicated trace.

None

text_anchor

str
indexed

Position of the text relative to the point.
Valid values are: top, bottom, left, and right.

None

xaxis

str
indexed

The x axis identifier for the indicated trace.

None

yaxis

str
indexed

The y axis identifier for the indicated trace.

None

width

Union[str, int, float]

The width of this chart, in CSS units.

100%

height

Union[str, int, float]

The height of this chart, in CSS units.

None

template

dict

The Plotly layout template.

None

decimator

taipy.gui.data.Decimator
indexed

A decimator instance for the indicated trace that reduces the volume of the data being sent back and forth.
If defined as indexed, it impacts only the indicated trace; if not, it applies to the first trace only.

None

rebuild

bool
dynamic

Allows dynamic config refresh if set to True.

False

figure

plotly.graph_objects.Figure
dynamic

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.
This function is invoked with the following parameters:

  • state (State): the state instance.
  • id (str): the identifier of the chart control if it has one.
  • payload (dict[str, Any]): a dictionary containing the x and y coordinates of the click or latitude and longitude in the case of a map. This feature relies on non-public Plotly structured information.
None

on_change

Union[str, Callable]

A function or the name of a function that is triggered when the value is updated.
This function is invoked with the following parameters:

  • state (State): the state instance.
  • var_name (str): the variable name.
  • value (Any): the new value.
None

propagate

bool

Allows the control's main value to be automatically propagated.
The default value is defined at the application configuration level by the propagate configuration option.
If True, any change to the control's value is immediately reflected in the bound application variable.

App config

active

bool
dynamic

Indicates if this component is active.
An inactive component allows no user interaction.

True

id

str

The identifier that is assigned to the rendered HTML component.

None

properties

dict[str, Any]

Bound to a dictionary that contains additional properties for this element.

None

class_name

str
dynamic

The list of CSS class names that are associated with the generated HTML Element.
These class names are added to the default taipy-chart class name.

None

hover_text

str
dynamic

The information that is displayed when the user hovers over this element.

None