Skip to content

Commit

Permalink
Merge pull request pyecharts#2345 from hanteng/patch-2
Browse files Browse the repository at this point in the history
Update series_options.py
  • Loading branch information
sunhailin-Leo authored Jun 19, 2024
2 parents 8051e24 + 4eafa58 commit dc821f8
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pyecharts/options/series_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ def __init__(
padding: Union[Numeric, Sequence[Numeric], None] = None,
text_width: Optional[Numeric] = None,
text_height: Optional[Numeric] = None,
text_border_color: Optional[str] = None,
text_border_width: Optional[Numeric] = None,
text_shadow_color: Optional[str] = None,
text_shadow_blur: Optional[Numeric] = None,
text_shadow_offset_x: Optional[Numeric] = None,
text_shadow_offset_y: Optional[Numeric] = None,
overflow: Optional[str] = None,
rich: Optional[dict] = None,
):
Expand All @@ -135,6 +141,12 @@ def __init__(
"padding": padding,
"width": text_width,
"height": text_height,
"textBorderColor": text_border_color,
"textBorderWidth": text_border_width,
"textShadowColor": text_shadow_color,
"textShadowBlur": text_shadow_blur,
"textShadowOffsetX": text_shadow_offset_x,
"textShadowOffsetY": text_shadow_offset_y,
"overflow": overflow,
"rich": rich,
}
Expand Down
18 changes: 18 additions & 0 deletions test/test_series_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ def test_label_options_defaults(self):
"padding": None,
"width": None,
"height": None,
"textBorderColor": None,
"textBorderWidth": None,
"textShadowColor": None,
"textShadowBlur": None,
"textShadowOffsetX": None,
"textShadowOffsetY": None,
"overflow": None,
"rich": None,
}
Expand All @@ -50,6 +56,12 @@ def test_label_options_custom(self):
border_color="green",
border_width=1,
border_radius=2,
text_border_color="black",
text_border_width=3,
text_shadow_color="whitesmoke",
text_shadow_blur=.1,
text_shadow_offset_x=.2,
text_shadow_offset_y=.3,
)
expected = {
"show": True,
Expand All @@ -73,6 +85,12 @@ def test_label_options_custom(self):
"padding": None,
"width": None,
"height": None,
"textBorderColor": "black",
"textBorderWidth": 3,
"textShadowColor": "whitesmoke",
"textShadowBlur": .1,
"textShadowOffsetX": .2,
"textShadowOffsetY": .3,
"overflow": None,
"rich": None,
}
Expand Down

0 comments on commit dc821f8

Please sign in to comment.