0
# Configuration Options
1
2
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).
3
4
## Capabilities
5
6
### Chart Initialization
7
8
Basic chart setup and rendering configuration.
9
10
```python { .api }
11
class InitOpts:
12
def __init__(self, **kwargs):
13
"""
14
Chart initialization options.
15
16
Args:
17
width (str): Chart width ("900px", "100%")
18
height (str): Chart height ("500px", "100%")
19
chart_id (str): Custom chart DOM ID
20
page_title (str): HTML page title
21
theme (str): Chart theme ("white", "dark", "vintage", "roma", etc.)
22
bg_color (str): Background color
23
is_horizontal_center (bool): Center chart horizontally
24
renderer (str): Rendering engine ("canvas", "svg")
25
fill_bg (bool): Fill background
26
"""
27
28
class RenderOpts:
29
def __init__(self, **kwargs):
30
"""
31
Chart rendering options.
32
33
Args:
34
chart_id (str): Chart container ID
35
"""
36
```
37
38
### Global Chart Options
39
40
Chart-wide configuration affecting overall appearance and behavior.
41
42
```python { .api }
43
class TitleOpts:
44
def __init__(self, **kwargs):
45
"""
46
Chart title configuration.
47
48
Args:
49
title (str): Main title text
50
subtitle (str): Subtitle text
51
pos_left (str): Horizontal position ("center", "left", "right", "20%", 100)
52
pos_top (str): Vertical position ("top", "middle", "bottom", "20%", 100)
53
pos_right (str): Right position
54
pos_bottom (str): Bottom position
55
padding (int|list): Title padding
56
item_gap (int): Gap between title and subtitle
57
title_textstyle_opts (TextStyleOpts): Main title text styling
58
subtitle_textstyle_opts (TextStyleOpts): Subtitle text styling
59
"""
60
61
class LegendOpts:
62
def __init__(self, **kwargs):
63
"""
64
Legend configuration.
65
66
Args:
67
type_ (str): Legend type ("plain", "scroll")
68
is_show (bool): Show legend
69
pos_left (str): Horizontal position
70
pos_top (str): Vertical position
71
pos_right (str): Right position
72
pos_bottom (str): Bottom position
73
orient (str): Orientation ("horizontal", "vertical")
74
align (str): Alignment ("auto", "left", "right")
75
padding (int|list): Legend padding
76
item_gap (int): Gap between legend items
77
item_width (int): Legend symbol width
78
item_height (int): Legend symbol height
79
is_show_symbol (bool): Show legend symbols
80
symbol (str): Legend symbol type
81
selected_mode (str|bool): Selection mode ("single", "multiple", True, False)
82
selected (dict): Initial selection state
83
formatter (str|JsCode): Legend text formatter
84
textstyle_opts (TextStyleOpts): Legend text styling
85
"""
86
87
class TooltipOpts:
88
def __init__(self, **kwargs):
89
"""
90
Tooltip configuration.
91
92
Args:
93
is_show (bool): Show tooltip
94
trigger (str): Trigger type ("item", "axis", "none")
95
trigger_on (str): Trigger event ("mousemove", "click", "mousemove|click")
96
axis_pointer_type (str): Axis pointer type ("line", "shadow", "cross")
97
is_show_content (bool): Show tooltip content
98
is_always_show_content (bool): Always show content
99
show_delay (int): Show delay in milliseconds
100
hide_delay (int): Hide delay in milliseconds
101
enterable (bool): Mouse can enter tooltip area
102
confine_to_body (bool): Confine tooltip to body
103
transition_duration (float): Transition animation duration
104
position (str|list|JsCode): Tooltip position
105
formatter (str|JsCode): Content formatter
106
background_color (str): Background color
107
border_color (str): Border color
108
border_width (int): Border width
109
textstyle_opts (TextStyleOpts): Text styling
110
"""
111
112
class ToolboxOpts:
113
def __init__(self, **kwargs):
114
"""
115
Toolbox configuration.
116
117
Args:
118
is_show (bool): Show toolbox
119
orient (str): Orientation ("horizontal", "vertical")
120
pos_left (str): Horizontal position
121
pos_top (str): Vertical position
122
pos_right (str): Right position
123
pos_bottom (str): Bottom position
124
feature (ToolBoxFeatureOpts): Toolbox features
125
"""
126
```
127
128
### Axis Configuration
129
130
Coordinate system and axis styling options.
131
132
```python { .api }
133
class AxisOpts:
134
def __init__(self, **kwargs):
135
"""
136
Axis configuration.
137
138
Args:
139
type_ (str): Axis type ("value", "category", "time", "log")
140
name (str): Axis name
141
name_location (str): Name position ("start", "middle", "end")
142
name_gap (int): Gap between name and axis line
143
name_rotate (int): Name rotation angle
144
is_inverse (bool): Inverse axis direction
145
name_textstyle_opts (TextStyleOpts): Name text styling
146
axislabel_opts (LabelOpts): Axis label options
147
axisline_opts (AxisLineOpts): Axis line options
148
axistick_opts (AxisTickOpts): Axis tick options
149
splitline_opts (SplitLineOpts): Split line options
150
splitarea_opts (SplitAreaOpts): Split area options
151
minor_tick_opts (MinorTickOpts): Minor tick options
152
minor_splitline_opts (MinorSplitLineOpts): Minor split line options
153
axispointer_opts (AxisPointerOpts): Axis pointer options
154
data (list): Category data for category axes
155
boundary_gap (bool|list): Boundary gap settings
156
min_ (str|int): Minimum value
157
max_ (str|int): Maximum value
158
scale (bool): Scale axis automatically
159
split_number (int): Number of segments
160
min_interval (int): Minimum interval
161
max_interval (int): Maximum interval
162
interval (int): Fixed interval
163
log_base (int): Log base for log axes
164
silent (bool): Disable interaction
165
trigger_event (bool): Trigger axis events
166
position (str): Axis position ("top", "bottom", "left", "right")
167
offset (int): Axis offset
168
z (int): Z-index
169
"""
170
171
class AxisLineOpts:
172
def __init__(self, **kwargs):
173
"""
174
Axis line styling.
175
176
Args:
177
is_show (bool): Show axis line
178
is_on_zero (bool): Show on zero line
179
on_zero_axis_index (int): Zero axis index
180
symbol (str|list): Line end symbols
181
symbol_size (int|list): Symbol sizes
182
symbol_offset (int|list): Symbol offsets
183
linestyle_opts (LineStyleOpts): Line styling
184
"""
185
186
class AxisTickOpts:
187
def __init__(self, **kwargs):
188
"""
189
Axis tick styling.
190
191
Args:
192
is_show (bool): Show axis ticks
193
is_align_with_label (bool): Align with labels
194
is_inside (bool): Ticks inside axis
195
length (int): Tick length
196
linestyle_opts (LineStyleOpts): Tick line styling
197
"""
198
199
class AxisPointerOpts:
200
def __init__(self, **kwargs):
201
"""
202
Axis pointer configuration.
203
204
Args:
205
is_show (bool): Show axis pointer
206
type_ (str): Pointer type ("line", "shadow", "none")
207
snap (bool): Snap to data points
208
z (int): Z-index
209
label (dict): Pointer label options
210
linestyle_opts (LineStyleOpts): Pointer line styling
211
shadowstyle_opts (dict): Shadow styling
212
trigger_tooltip (bool): Trigger tooltip
213
value (str|int): Fixed pointer value
214
status (str): Pointer status
215
"""
216
```
217
218
### Visual Mapping
219
220
Data-driven visual encoding options.
221
222
```python { .api }
223
class VisualMapOpts:
224
def __init__(self, **kwargs):
225
"""
226
Visual mapping configuration.
227
228
Args:
229
type_ (str): Visual map type ("continuous", "piecewise")
230
is_show (bool): Show visual map component
231
dimension (int): Data dimension to map
232
pos_left (str): Horizontal position
233
pos_top (str): Vertical position
234
pos_right (str): Right position
235
pos_bottom (str): Bottom position
236
orient (str): Orientation ("horizontal", "vertical")
237
is_piecewise (bool): Use piecewise mapping
238
is_inverse (bool): Inverse mapping direction
239
is_calculable (bool): Enable draggable handles
240
precision (int): Label precision
241
pieces (list): Piecewise ranges
242
categories (list): Category names
243
min_ (int): Minimum value
244
max_ (int): Maximum value
245
range_ (list): Visual range
246
text (list): Text labels ["High", "Low"]
247
text_gap (int): Gap between text and component
248
show_label (bool): Show labels
249
item_width (int): Item width
250
item_height (int): Item height
251
align (str): Alignment ("auto", "left", "right")
252
text_style_opts (TextStyleOpts): Text styling
253
formatter (str|JsCode): Label formatter
254
background_color (str): Background color
255
border_color (str): Border color
256
border_width (int): Border width
257
color (list): Color palette
258
opacity (list): Opacity range
259
symbol (str): Symbol type
260
symbol_size (list): Symbol size range
261
"""
262
```
263
264
### Data Zoom and Interaction
265
266
Interactive data exploration controls.
267
268
```python { .api }
269
class DataZoomOpts:
270
def __init__(self, **kwargs):
271
"""
272
Data zoom configuration.
273
274
Args:
275
is_show (bool): Show data zoom component
276
type_ (str): Zoom type ("slider", "inside")
277
range_start (int): Start percentage (0-100)
278
range_end (int): End percentage (0-100)
279
orient (str): Orientation ("horizontal", "vertical")
280
pos_left (str): Horizontal position
281
pos_top (str): Vertical position
282
pos_right (str): Right position
283
pos_bottom (str): Bottom position
284
xaxis_index (int|list): X-axis indices to control
285
yaxis_index (int|list): Y-axis indices to control
286
filter_mode (str): Filter mode ("filter", "weakFilter", "empty", "none")
287
start_value (str|int): Start value
288
end_value (str|int): End value
289
min_span (int): Minimum span percentage
290
max_span (int): Maximum span percentage
291
min_value_span (str|int): Minimum value span
292
max_value_span (str|int): Maximum value span
293
realtime (bool): Real-time update
294
text_style_opts (TextStyleOpts): Text styling
295
"""
296
297
class BrushOpts:
298
def __init__(self, **kwargs):
299
"""
300
Data brushing/selection configuration.
301
302
Args:
303
tool_box (list): Available brush tools
304
brush_link (str|list): Link brushing across charts
305
series_index (str|list): Series indices to brush
306
geo_index (str|list): Geo indices to brush
307
xaxis_index (str|list): X-axis indices to brush
308
yaxis_index (str|list): Y-axis indices to brush
309
brush_type (str): Brush type ("rect", "polygon", "lineX", "lineY")
310
brush_mode (str): Brush mode ("single", "multiple")
311
transformable (bool): Enable brush transformation
312
brush_style (dict): Brush area styling
313
throttle_type (str): Throttle type ("fixRate", "debounce")
314
throttle_delay (int): Throttle delay
315
remove_on_click (bool): Remove brush on click
316
in_brush (dict): In-brush styling
317
out_of_brush (dict): Out-of-brush styling
318
"""
319
```
320
321
### Series-Level Options
322
323
Options that apply to individual data series.
324
325
```python { .api }
326
class LabelOpts:
327
def __init__(self, **kwargs):
328
"""
329
Data label configuration.
330
331
Args:
332
is_show (bool): Show labels
333
position (str|list): Label position ("top", "bottom", "left", "right", "inside", "outside", etc.)
334
distance (int): Distance from data point
335
rotate (int): Label rotation angle
336
offset (list): Label offset [x, y]
337
color (str): Label color
338
font_size (int): Font size
339
font_style (str): Font style ("normal", "italic", "oblique")
340
font_weight (str): Font weight ("normal", "bold", "bolder", "lighter")
341
font_family (str): Font family
342
line_height (int): Line height
343
background_color (str): Background color
344
border_color (str): Border color
345
border_width (int): Border width
346
border_radius (int): Border radius
347
padding (int|list): Label padding
348
shadow_color (str): Shadow color
349
shadow_blur (int): Shadow blur
350
shadow_offset_x (int): Shadow X offset
351
shadow_offset_y (int): Shadow Y offset
352
width (int): Label width
353
height (int): Label height
354
text_border_color (str): Text border color
355
text_border_width (int): Text border width
356
text_shadow_color (str): Text shadow color
357
text_shadow_blur (int): Text shadow blur
358
text_shadow_offset_x (int): Text shadow X offset
359
text_shadow_offset_y (int): Text shadow Y offset
360
formatter (str|JsCode): Label formatter
361
"""
362
363
class ItemStyleOpts:
364
def __init__(self, **kwargs):
365
"""
366
Item/point styling configuration.
367
368
Args:
369
color (str): Item color
370
color0 (str): Secondary color (for candlestick charts)
371
border_color (str): Border color
372
border_color0 (str): Secondary border color
373
border_width (int): Border width
374
border_type (str): Border type ("solid", "dashed", "dotted")
375
opacity (float): Item opacity (0-1)
376
shadow_blur (int): Shadow blur radius
377
shadow_color (str): Shadow color
378
shadow_offset_x (int): Shadow X offset
379
shadow_offset_y (int): Shadow Y offset
380
"""
381
382
class LineStyleOpts:
383
def __init__(self, **kwargs):
384
"""
385
Line styling configuration.
386
387
Args:
388
is_show (bool): Show line
389
width (int): Line width
390
color (str): Line color
391
type_ (str): Line type ("solid", "dashed", "dotted")
392
opacity (float): Line opacity (0-1)
393
curve_ness (float): Line curvature (0-1)
394
shadow_blur (int): Shadow blur radius
395
shadow_color (str): Shadow color
396
shadow_offset_x (int): Shadow X offset
397
shadow_offset_y (int): Shadow Y offset
398
"""
399
400
class AreaStyleOpts:
401
def __init__(self, **kwargs):
402
"""
403
Area fill styling configuration.
404
405
Args:
406
opacity (float): Area opacity (0-1)
407
color (str): Fill color
408
origin (str): Fill origin ("auto", "start", "end")
409
shadow_blur (int): Shadow blur radius
410
shadow_color (str): Shadow color
411
shadow_offset_x (int): Shadow X offset
412
shadow_offset_y (int): Shadow Y offset
413
"""
414
```
415
416
### Mark Elements
417
418
Annotation and highlighting options.
419
420
```python { .api }
421
class MarkPointOpts:
422
def __init__(self, **kwargs):
423
"""
424
Mark point configuration.
425
426
Args:
427
data (list): List of MarkPointItem objects
428
symbol (str): Mark symbol type
429
symbol_size (int): Symbol size
430
precision (int): Value precision
431
label_opts (LabelOpts): Label styling
432
itemstyle_opts (ItemStyleOpts): Item styling
433
"""
434
435
class MarkLineOpts:
436
def __init__(self, **kwargs):
437
"""
438
Mark line configuration.
439
440
Args:
441
is_silent (bool): Disable interaction
442
data (list): List of MarkLineItem objects
443
precision (int): Value precision
444
symbol (str|list): Line end symbols
445
symbol_size (int|list): Symbol sizes
446
label_opts (LabelOpts): Label styling
447
linestyle_opts (LineStyleOpts): Line styling
448
"""
449
450
class MarkAreaOpts:
451
def __init__(self, **kwargs):
452
"""
453
Mark area configuration.
454
455
Args:
456
is_silent (bool): Disable interaction
457
data (list): List of MarkAreaItem objects
458
precision (int): Value precision
459
label_opts (LabelOpts): Label styling
460
itemstyle_opts (ItemStyleOpts): Area styling
461
"""
462
```
463
464
### Text and Typography
465
466
```python { .api }
467
class TextStyleOpts:
468
def __init__(self, **kwargs):
469
"""
470
Text styling configuration.
471
472
Args:
473
color (str): Text color
474
font_style (str): Font style ("normal", "italic", "oblique")
475
font_weight (str): Font weight ("normal", "bold", "bolder", "lighter")
476
font_family (str): Font family
477
font_size (int): Font size
478
line_height (int): Line height
479
width (int): Text width
480
height (int): Text height
481
text_border_color (str): Text border color
482
text_border_width (int): Text border width
483
text_shadow_color (str): Text shadow color
484
text_shadow_blur (int): Text shadow blur
485
text_shadow_offset_x (int): Text shadow X offset
486
text_shadow_offset_y (int): Text shadow Y offset
487
"""
488
```
489
490
### Animation Options
491
492
```python { .api }
493
class AnimationOpts:
494
def __init__(self, **kwargs):
495
"""
496
Animation configuration.
497
498
Args:
499
animation (bool): Enable animation
500
animation_threshold (int): Animation threshold
501
animation_duration (int): Animation duration in milliseconds
502
animation_easing (str): Animation easing function
503
animation_delay (int|JsCode): Animation delay
504
animation_duration_update (int): Update animation duration
505
animation_easing_update (str): Update animation easing
506
animation_delay_update (int|JsCode): Update animation delay
507
"""
508
```
509
510
### Effects and Interactions
511
512
```python { .api }
513
class EffectOpts:
514
def __init__(self, **kwargs):
515
"""
516
Animation effects configuration.
517
518
Args:
519
is_show (bool): Show effects
520
brush_type (str): Brush effect type ("stroke", "fill")
521
scale (int): Effect scale
522
period (int): Effect period
523
color (str): Effect color
524
symbol (str): Effect symbol
525
symbol_size (int): Effect symbol size
526
loop (bool): Loop animation
527
trail_length (float): Trail length ratio
528
"""
529
530
class EmphasisOpts:
531
def __init__(self, **kwargs):
532
"""
533
Emphasis/hover effects configuration.
534
535
Args:
536
is_disabled (bool): Disable emphasis
537
scale (bool|float): Scale on emphasis
538
focus (str): Focus behavior ("none", "self", "series")
539
blur_scope (str): Blur scope ("coordinateSystem", "series", "global")
540
label_opts (LabelOpts): Emphasis label styling
541
itemstyle_opts (ItemStyleOpts): Emphasis item styling
542
linestyle_opts (LineStyleOpts): Emphasis line styling
543
areastyle_opts (AreaStyleOpts): Emphasis area styling
544
"""
545
546
class SelectOpts:
547
def __init__(self, **kwargs):
548
"""
549
Selection effects configuration.
550
551
Args:
552
is_disabled (bool): Disable selection
553
label_opts (LabelOpts): Selection label styling
554
itemstyle_opts (ItemStyleOpts): Selection item styling
555
linestyle_opts (LineStyleOpts): Selection line styling
556
areastyle_opts (AreaStyleOpts): Selection area styling
557
"""
558
559
class BlurOpts:
560
def __init__(self, **kwargs):
561
"""
562
Blur effects configuration.
563
564
Args:
565
label_opts (LabelOpts): Blur label styling
566
itemstyle_opts (ItemStyleOpts): Blur item styling
567
linestyle_opts (LineStyleOpts): Blur line styling
568
areastyle_opts (AreaStyleOpts): Blur area styling
569
"""
570
```