Python API

Dash component

class dash_echartsx.DashEChartsX(id=None, className=None, style=None, option=None, maps=None, enable_gl=None, gl_bundle_url=None, notMerge=None, lazyUpdate=None, renderer=None, theme=None, click_data=None, dblclick_data=None, hover_data=None, selected_data=None, legend_status=None, zoom_data=None, dispatch_action=None, append_data=None, ref=None, key=None, **kwargs)[source]

Bases: Component

A DashEChartsX component.

Keyword arguments:

  • id (string; optional):

    Unique identifier for the component. Defaults to None when omitted.

  • append_data (dict; optional):

    Append a batch of data to an ECharts series without resending its full option. Defaults to None when omitted.

    append_data is a dict with keys:

    • seriesIndex (number; required)

    • data (boolean | number | string | dict | list; required)

  • className (string; optional):

    CSS class applied to the component container. Defaults to None when omitted.

  • click_data (boolean | number | string | dict | list; optional):

    Latest click event with seriesIndex, dataIndex, name, and value when available. Defaults to None when omitted.

  • dblclick_data (boolean | number | string | dict | list; optional):

    Latest double-click event with seriesIndex, dataIndex, name, and value when available. Defaults to None when omitted.

  • dispatch_action (boolean | number | string | dict | list; optional):

    Dispatch a supported ECharts action when this payload changes. Defaults to None when omitted.

  • enable_gl (boolean; optional):

    Lazily load ECharts-GL before applying 3D/WebGL options. Defaults to False.

  • gl_bundle_url (string; optional):

    Optional URL override for the separately served ECharts-GL bundle. Defaults to None when omitted.

  • hover_data (boolean | number | string | dict | list; optional):

    Latest pointer-over event with seriesIndex, dataIndex, name, and value when available. Defaults to None when omitted.

  • key (string | number; optional)

  • lazyUpdate (boolean; optional):

    Defer option updates until the next animation frame. Defaults to False.

  • legend_status (boolean | number | string | dict | list; optional):

    Latest legend selection event with the legend name and selection state. Defaults to None when omitted.

  • maps (boolean | number | string | dict | list; optional):

    GeoJSON or SVG map definitions registered before applying the option. Defaults to None when omitted.

  • notMerge (boolean; optional):

    Replace the current option instead of merging it. Defaults to False.

  • option (boolean | number | string | dict | list; optional):

    ECharts option object. Defaults to None when omitted.

  • ref (string; optional):

    Allows getting a ref to the component instance. Once the component unmounts, React will set ref.current to None (or call the ref with None if you passed a callback ref). @,see,,{@link ,https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs,}.

  • renderer (a value equal to: None, ‘canvas’, ‘svg’; optional):

    Rendering engine used by ECharts. Defaults to “canvas”.

  • selected_data (boolean | number | string | dict | list; optional):

    Latest selection-change event, including the selected series and data indexes. Defaults to None when omitted.

  • theme (dict; optional):

    Named light/dark theme or a custom ECharts theme object. Defaults to None when omitted.

  • zoom_data (boolean | number | string | dict | list; optional):

    Latest data-zoom event with range and value bounds when available. Defaults to None when omitted.

Parameters:
class AppendData

Bases: TypedDict

Helpers

dash_echartsx.utils.js_function(source)[source]

Mark JavaScript source for client-side evaluation by the component.

Parameters:

source (str)

Return type:

dict[str, str]

dash_echartsx.utils.option(**values)[source]

Build an ECharts option dictionary from keyword arguments.

Parameters:

values (Any)

Return type:

dict[str, Any]