Python ❤️ ECharts = pyecharts - comprehensive data visualization toolkit built on Apache ECharts
—
Comprehensive styling and behavior configuration system for customizing all aspects of pyecharts visualizations. The options system is divided into global options (affecting entire charts) and series options (affecting individual data series).
Basic chart setup and rendering configuration.
class InitOpts:
def __init__(self, **kwargs):
"""
Chart initialization options.
Args:
width (str): Chart width ("900px", "100%")
height (str): Chart height ("500px", "100%")
chart_id (str): Custom chart DOM ID
page_title (str): HTML page title
theme (str): Chart theme ("white", "dark", "vintage", "roma", etc.)
bg_color (str): Background color
is_horizontal_center (bool): Center chart horizontally
renderer (str): Rendering engine ("canvas", "svg")
fill_bg (bool): Fill background
"""
class RenderOpts:
def __init__(self, **kwargs):
"""
Chart rendering options.
Args:
chart_id (str): Chart container ID
"""Chart-wide configuration affecting overall appearance and behavior.
class TitleOpts:
def __init__(self, **kwargs):
"""
Chart title configuration.
Args:
title (str): Main title text
subtitle (str): Subtitle text
pos_left (str): Horizontal position ("center", "left", "right", "20%", 100)
pos_top (str): Vertical position ("top", "middle", "bottom", "20%", 100)
pos_right (str): Right position
pos_bottom (str): Bottom position
padding (int|list): Title padding
item_gap (int): Gap between title and subtitle
title_textstyle_opts (TextStyleOpts): Main title text styling
subtitle_textstyle_opts (TextStyleOpts): Subtitle text styling
"""
class LegendOpts:
def __init__(self, **kwargs):
"""
Legend configuration.
Args:
type_ (str): Legend type ("plain", "scroll")
is_show (bool): Show legend
pos_left (str): Horizontal position
pos_top (str): Vertical position
pos_right (str): Right position
pos_bottom (str): Bottom position
orient (str): Orientation ("horizontal", "vertical")
align (str): Alignment ("auto", "left", "right")
padding (int|list): Legend padding
item_gap (int): Gap between legend items
item_width (int): Legend symbol width
item_height (int): Legend symbol height
is_show_symbol (bool): Show legend symbols
symbol (str): Legend symbol type
selected_mode (str|bool): Selection mode ("single", "multiple", True, False)
selected (dict): Initial selection state
formatter (str|JsCode): Legend text formatter
textstyle_opts (TextStyleOpts): Legend text styling
"""
class TooltipOpts:
def __init__(self, **kwargs):
"""
Tooltip configuration.
Args:
is_show (bool): Show tooltip
trigger (str): Trigger type ("item", "axis", "none")
trigger_on (str): Trigger event ("mousemove", "click", "mousemove|click")
axis_pointer_type (str): Axis pointer type ("line", "shadow", "cross")
is_show_content (bool): Show tooltip content
is_always_show_content (bool): Always show content
show_delay (int): Show delay in milliseconds
hide_delay (int): Hide delay in milliseconds
enterable (bool): Mouse can enter tooltip area
confine_to_body (bool): Confine tooltip to body
transition_duration (float): Transition animation duration
position (str|list|JsCode): Tooltip position
formatter (str|JsCode): Content formatter
background_color (str): Background color
border_color (str): Border color
border_width (int): Border width
textstyle_opts (TextStyleOpts): Text styling
"""
class ToolboxOpts:
def __init__(self, **kwargs):
"""
Toolbox configuration.
Args:
is_show (bool): Show toolbox
orient (str): Orientation ("horizontal", "vertical")
pos_left (str): Horizontal position
pos_top (str): Vertical position
pos_right (str): Right position
pos_bottom (str): Bottom position
feature (ToolBoxFeatureOpts): Toolbox features
"""Coordinate system and axis styling options.
class AxisOpts:
def __init__(self, **kwargs):
"""
Axis configuration.
Args:
type_ (str): Axis type ("value", "category", "time", "log")
name (str): Axis name
name_location (str): Name position ("start", "middle", "end")
name_gap (int): Gap between name and axis line
name_rotate (int): Name rotation angle
is_inverse (bool): Inverse axis direction
name_textstyle_opts (TextStyleOpts): Name text styling
axislabel_opts (LabelOpts): Axis label options
axisline_opts (AxisLineOpts): Axis line options
axistick_opts (AxisTickOpts): Axis tick options
splitline_opts (SplitLineOpts): Split line options
splitarea_opts (SplitAreaOpts): Split area options
minor_tick_opts (MinorTickOpts): Minor tick options
minor_splitline_opts (MinorSplitLineOpts): Minor split line options
axispointer_opts (AxisPointerOpts): Axis pointer options
data (list): Category data for category axes
boundary_gap (bool|list): Boundary gap settings
min_ (str|int): Minimum value
max_ (str|int): Maximum value
scale (bool): Scale axis automatically
split_number (int): Number of segments
min_interval (int): Minimum interval
max_interval (int): Maximum interval
interval (int): Fixed interval
log_base (int): Log base for log axes
silent (bool): Disable interaction
trigger_event (bool): Trigger axis events
position (str): Axis position ("top", "bottom", "left", "right")
offset (int): Axis offset
z (int): Z-index
"""
class AxisLineOpts:
def __init__(self, **kwargs):
"""
Axis line styling.
Args:
is_show (bool): Show axis line
is_on_zero (bool): Show on zero line
on_zero_axis_index (int): Zero axis index
symbol (str|list): Line end symbols
symbol_size (int|list): Symbol sizes
symbol_offset (int|list): Symbol offsets
linestyle_opts (LineStyleOpts): Line styling
"""
class AxisTickOpts:
def __init__(self, **kwargs):
"""
Axis tick styling.
Args:
is_show (bool): Show axis ticks
is_align_with_label (bool): Align with labels
is_inside (bool): Ticks inside axis
length (int): Tick length
linestyle_opts (LineStyleOpts): Tick line styling
"""
class AxisPointerOpts:
def __init__(self, **kwargs):
"""
Axis pointer configuration.
Args:
is_show (bool): Show axis pointer
type_ (str): Pointer type ("line", "shadow", "none")
snap (bool): Snap to data points
z (int): Z-index
label (dict): Pointer label options
linestyle_opts (LineStyleOpts): Pointer line styling
shadowstyle_opts (dict): Shadow styling
trigger_tooltip (bool): Trigger tooltip
value (str|int): Fixed pointer value
status (str): Pointer status
"""Data-driven visual encoding options.
class VisualMapOpts:
def __init__(self, **kwargs):
"""
Visual mapping configuration.
Args:
type_ (str): Visual map type ("continuous", "piecewise")
is_show (bool): Show visual map component
dimension (int): Data dimension to map
pos_left (str): Horizontal position
pos_top (str): Vertical position
pos_right (str): Right position
pos_bottom (str): Bottom position
orient (str): Orientation ("horizontal", "vertical")
is_piecewise (bool): Use piecewise mapping
is_inverse (bool): Inverse mapping direction
is_calculable (bool): Enable draggable handles
precision (int): Label precision
pieces (list): Piecewise ranges
categories (list): Category names
min_ (int): Minimum value
max_ (int): Maximum value
range_ (list): Visual range
text (list): Text labels ["High", "Low"]
text_gap (int): Gap between text and component
show_label (bool): Show labels
item_width (int): Item width
item_height (int): Item height
align (str): Alignment ("auto", "left", "right")
text_style_opts (TextStyleOpts): Text styling
formatter (str|JsCode): Label formatter
background_color (str): Background color
border_color (str): Border color
border_width (int): Border width
color (list): Color palette
opacity (list): Opacity range
symbol (str): Symbol type
symbol_size (list): Symbol size range
"""Interactive data exploration controls.
class DataZoomOpts:
def __init__(self, **kwargs):
"""
Data zoom configuration.
Args:
is_show (bool): Show data zoom component
type_ (str): Zoom type ("slider", "inside")
range_start (int): Start percentage (0-100)
range_end (int): End percentage (0-100)
orient (str): Orientation ("horizontal", "vertical")
pos_left (str): Horizontal position
pos_top (str): Vertical position
pos_right (str): Right position
pos_bottom (str): Bottom position
xaxis_index (int|list): X-axis indices to control
yaxis_index (int|list): Y-axis indices to control
filter_mode (str): Filter mode ("filter", "weakFilter", "empty", "none")
start_value (str|int): Start value
end_value (str|int): End value
min_span (int): Minimum span percentage
max_span (int): Maximum span percentage
min_value_span (str|int): Minimum value span
max_value_span (str|int): Maximum value span
realtime (bool): Real-time update
text_style_opts (TextStyleOpts): Text styling
"""
class BrushOpts:
def __init__(self, **kwargs):
"""
Data brushing/selection configuration.
Args:
tool_box (list): Available brush tools
brush_link (str|list): Link brushing across charts
series_index (str|list): Series indices to brush
geo_index (str|list): Geo indices to brush
xaxis_index (str|list): X-axis indices to brush
yaxis_index (str|list): Y-axis indices to brush
brush_type (str): Brush type ("rect", "polygon", "lineX", "lineY")
brush_mode (str): Brush mode ("single", "multiple")
transformable (bool): Enable brush transformation
brush_style (dict): Brush area styling
throttle_type (str): Throttle type ("fixRate", "debounce")
throttle_delay (int): Throttle delay
remove_on_click (bool): Remove brush on click
in_brush (dict): In-brush styling
out_of_brush (dict): Out-of-brush styling
"""Options that apply to individual data series.
class LabelOpts:
def __init__(self, **kwargs):
"""
Data label configuration.
Args:
is_show (bool): Show labels
position (str|list): Label position ("top", "bottom", "left", "right", "inside", "outside", etc.)
distance (int): Distance from data point
rotate (int): Label rotation angle
offset (list): Label offset [x, y]
color (str): Label color
font_size (int): Font size
font_style (str): Font style ("normal", "italic", "oblique")
font_weight (str): Font weight ("normal", "bold", "bolder", "lighter")
font_family (str): Font family
line_height (int): Line height
background_color (str): Background color
border_color (str): Border color
border_width (int): Border width
border_radius (int): Border radius
padding (int|list): Label padding
shadow_color (str): Shadow color
shadow_blur (int): Shadow blur
shadow_offset_x (int): Shadow X offset
shadow_offset_y (int): Shadow Y offset
width (int): Label width
height (int): Label height
text_border_color (str): Text border color
text_border_width (int): Text border width
text_shadow_color (str): Text shadow color
text_shadow_blur (int): Text shadow blur
text_shadow_offset_x (int): Text shadow X offset
text_shadow_offset_y (int): Text shadow Y offset
formatter (str|JsCode): Label formatter
"""
class ItemStyleOpts:
def __init__(self, **kwargs):
"""
Item/point styling configuration.
Args:
color (str): Item color
color0 (str): Secondary color (for candlestick charts)
border_color (str): Border color
border_color0 (str): Secondary border color
border_width (int): Border width
border_type (str): Border type ("solid", "dashed", "dotted")
opacity (float): Item opacity (0-1)
shadow_blur (int): Shadow blur radius
shadow_color (str): Shadow color
shadow_offset_x (int): Shadow X offset
shadow_offset_y (int): Shadow Y offset
"""
class LineStyleOpts:
def __init__(self, **kwargs):
"""
Line styling configuration.
Args:
is_show (bool): Show line
width (int): Line width
color (str): Line color
type_ (str): Line type ("solid", "dashed", "dotted")
opacity (float): Line opacity (0-1)
curve_ness (float): Line curvature (0-1)
shadow_blur (int): Shadow blur radius
shadow_color (str): Shadow color
shadow_offset_x (int): Shadow X offset
shadow_offset_y (int): Shadow Y offset
"""
class AreaStyleOpts:
def __init__(self, **kwargs):
"""
Area fill styling configuration.
Args:
opacity (float): Area opacity (0-1)
color (str): Fill color
origin (str): Fill origin ("auto", "start", "end")
shadow_blur (int): Shadow blur radius
shadow_color (str): Shadow color
shadow_offset_x (int): Shadow X offset
shadow_offset_y (int): Shadow Y offset
"""Annotation and highlighting options.
class MarkPointOpts:
def __init__(self, **kwargs):
"""
Mark point configuration.
Args:
data (list): List of MarkPointItem objects
symbol (str): Mark symbol type
symbol_size (int): Symbol size
precision (int): Value precision
label_opts (LabelOpts): Label styling
itemstyle_opts (ItemStyleOpts): Item styling
"""
class MarkLineOpts:
def __init__(self, **kwargs):
"""
Mark line configuration.
Args:
is_silent (bool): Disable interaction
data (list): List of MarkLineItem objects
precision (int): Value precision
symbol (str|list): Line end symbols
symbol_size (int|list): Symbol sizes
label_opts (LabelOpts): Label styling
linestyle_opts (LineStyleOpts): Line styling
"""
class MarkAreaOpts:
def __init__(self, **kwargs):
"""
Mark area configuration.
Args:
is_silent (bool): Disable interaction
data (list): List of MarkAreaItem objects
precision (int): Value precision
label_opts (LabelOpts): Label styling
itemstyle_opts (ItemStyleOpts): Area styling
"""class TextStyleOpts:
def __init__(self, **kwargs):
"""
Text styling configuration.
Args:
color (str): Text color
font_style (str): Font style ("normal", "italic", "oblique")
font_weight (str): Font weight ("normal", "bold", "bolder", "lighter")
font_family (str): Font family
font_size (int): Font size
line_height (int): Line height
width (int): Text width
height (int): Text height
text_border_color (str): Text border color
text_border_width (int): Text border width
text_shadow_color (str): Text shadow color
text_shadow_blur (int): Text shadow blur
text_shadow_offset_x (int): Text shadow X offset
text_shadow_offset_y (int): Text shadow Y offset
"""class AnimationOpts:
def __init__(self, **kwargs):
"""
Animation configuration.
Args:
animation (bool): Enable animation
animation_threshold (int): Animation threshold
animation_duration (int): Animation duration in milliseconds
animation_easing (str): Animation easing function
animation_delay (int|JsCode): Animation delay
animation_duration_update (int): Update animation duration
animation_easing_update (str): Update animation easing
animation_delay_update (int|JsCode): Update animation delay
"""class EffectOpts:
def __init__(self, **kwargs):
"""
Animation effects configuration.
Args:
is_show (bool): Show effects
brush_type (str): Brush effect type ("stroke", "fill")
scale (int): Effect scale
period (int): Effect period
color (str): Effect color
symbol (str): Effect symbol
symbol_size (int): Effect symbol size
loop (bool): Loop animation
trail_length (float): Trail length ratio
"""
class EmphasisOpts:
def __init__(self, **kwargs):
"""
Emphasis/hover effects configuration.
Args:
is_disabled (bool): Disable emphasis
scale (bool|float): Scale on emphasis
focus (str): Focus behavior ("none", "self", "series")
blur_scope (str): Blur scope ("coordinateSystem", "series", "global")
label_opts (LabelOpts): Emphasis label styling
itemstyle_opts (ItemStyleOpts): Emphasis item styling
linestyle_opts (LineStyleOpts): Emphasis line styling
areastyle_opts (AreaStyleOpts): Emphasis area styling
"""
class SelectOpts:
def __init__(self, **kwargs):
"""
Selection effects configuration.
Args:
is_disabled (bool): Disable selection
label_opts (LabelOpts): Selection label styling
itemstyle_opts (ItemStyleOpts): Selection item styling
linestyle_opts (LineStyleOpts): Selection line styling
areastyle_opts (AreaStyleOpts): Selection area styling
"""
class BlurOpts:
def __init__(self, **kwargs):
"""
Blur effects configuration.
Args:
label_opts (LabelOpts): Blur label styling
itemstyle_opts (ItemStyleOpts): Blur item styling
linestyle_opts (LineStyleOpts): Blur line styling
areastyle_opts (AreaStyleOpts): Blur area styling
"""Install with Tessl CLI
npx tessl i tessl/pypi-pyecharts