effectscatter.py
1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
from ... import options as opts
from ... import types
from ...charts.chart import RectChart
from ...globals import ChartType
class EffectScatter(RectChart):
"""
<<< Scatter plots with ripple effects animation >>>
Use animation effects to visually highlight designated data set.
"""
def add_yaxis(
self,
series_name: str,
y_axis: types.Sequence,
*,
is_selected: bool = True,
xaxis_index: types.Optional[types.Numeric] = None,
yaxis_index: types.Optional[types.Numeric] = None,
color: types.Optional[str] = None,
symbol: types.Optional[str] = None,
symbol_size: types.Numeric = 10,
symbol_rotate: types.Optional[types.Numeric] = None,
label_opts: types.Label = opts.LabelOpts(),
effect_opts: types.Effect = opts.EffectOpts(),
tooltip_opts: types.Tooltip = None,
itemstyle_opts: types.ItemStyle = None,
):
self._append_color(color)
self._append_legend(series_name, is_selected)
self.options.get("series").append(
{
"type": ChartType.EFFECT_SCATTER,
"name": series_name,
"xAxisIndex": xaxis_index,
"yAxisIndex": yaxis_index,
"showEffectOn": "render",
"rippleEffect": effect_opts,
"symbol": symbol,
"symbolSize": symbol_size,
"symbolRotate": symbol_rotate,
"data": [list(z) for z in zip(self._xaxis_data, y_axis)],
"label": label_opts,
"tooltip": tooltip_opts,
"itemStyle": itemstyle_opts,
}
)
return self