Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scatter 图可以自定义数据点名称 #651

Closed
chenjiandongx opened this issue Aug 2, 2018 · 0 comments
Closed

Scatter 图可以自定义数据点名称 #651

chenjiandongx opened this issue Aug 2, 2018 · 0 comments
Labels

Comments

@chenjiandongx
Copy link
Member

chenjiandongx commented Aug 2, 2018

V0.5.7 可用:Scatter 图新增 extra_name 参数,额外的数据项的名称,可以为每个数据点指定一个名称。

代码

from pyecharts import Scatter

def custom_formatter(params):
    return params.value[3]
 data = [
    [28604, 77, 17096],
    [31163, 77.4, 27662],
    [1516, 68, 11546],
]
x_lst = [v[0] for v in data]
y_lst = [v[1] for v in data]
extra_data = [v[2] for v in data]
extra_name = ["point A", "point B", "point C"]
sc = Scatter()
sc.add(
    "scatter",
    x_lst,
    y_lst,
    extra_data=extra_data,
    extra_name=extra_name,
    is_visualmap=True,
    visual_dimension=2,
    visual_orient="horizontal",
    visual_type="size",
    visual_range=[17000, 28000],
    visual_text_color="#000",
    tooltip_formatter=custom_formatter,
)
sc.render()

效果
scatter-demo

chenjiandongx added a commit that referenced this issue Aug 2, 2018
* Docs: 文档完善

* Add: #651 为 Scatter 图新增 extra_name 参数

* Update: 版本号更新

* Add: 新增 assert 判断
chenjiandongx added a commit that referenced this issue Aug 8, 2018
* Docs: 文档完善

* Add: #651 为 Scatter 图新增 extra_name 参数

* Update: 版本号更新

* Add: 新增 assert 判断

* Update: #657 新增额外的文本标签

* Docs: 对应文档更新

* Format: 代码格式化
chenjiandongx added a commit that referenced this issue Mar 26, 2019
* Docs: 文档完善

* Add: #651 为 Scatter 图新增 extra_name 参数

* Update: 版本号更新

* Add: 新增 assert 判断
chenjiandongx added a commit that referenced this issue Mar 26, 2019
* Docs: 文档完善

* Add: #651 为 Scatter 图新增 extra_name 参数

* Update: 版本号更新

* Add: 新增 assert 判断

* Update: #657 新增额外的文本标签

* Docs: 对应文档更新

* Format: 代码格式化
chenjiandongx added a commit that referenced this issue Mar 30, 2019
* Docs: 文档完善

* Add: #651 为 Scatter 图新增 extra_name 参数

* Update: 版本号更新

* Add: 新增 assert 判断
chenjiandongx added a commit that referenced this issue Mar 30, 2019
* Docs: 文档完善

* Add: #651 为 Scatter 图新增 extra_name 参数

* Update: 版本号更新

* Add: 新增 assert 判断

* Update: #657 新增额外的文本标签

* Docs: 对应文档更新

* Format: 代码格式化
chenjiandongx added a commit that referenced this issue Mar 30, 2019
* Docs: 文档完善

* Add: #651 为 Scatter 图新增 extra_name 参数

* Update: 版本号更新

* Add: 新增 assert 判断
chenjiandongx added a commit that referenced this issue Mar 30, 2019
* Docs: 文档完善

* Add: #651 为 Scatter 图新增 extra_name 参数

* Update: 版本号更新

* Add: 新增 assert 判断

* Update: #657 新增额外的文本标签

* Docs: 对应文档更新

* Format: 代码格式化
chenjiandongx added a commit that referenced this issue Mar 30, 2019
* Docs: 文档完善

* Add: #651 为 Scatter 图新增 extra_name 参数

* Update: 版本号更新

* Add: 新增 assert 判断
chenjiandongx added a commit that referenced this issue Mar 30, 2019
* Docs: 文档完善

* Add: #651 为 Scatter 图新增 extra_name 参数

* Update: 版本号更新

* Add: 新增 assert 判断

* Update: #657 新增额外的文本标签

* Docs: 对应文档更新

* Format: 代码格式化
chenjiandongx added a commit that referenced this issue Mar 30, 2019
* Docs: 文档完善

* Add: #651 为 Scatter 图新增 extra_name 参数

* Update: 版本号更新

* Add: 新增 assert 判断
chenjiandongx added a commit that referenced this issue Mar 30, 2019
* Docs: 文档完善

* Add: #651 为 Scatter 图新增 extra_name 参数

* Update: 版本号更新

* Add: 新增 assert 判断

* Update: #657 新增额外的文本标签

* Docs: 对应文档更新

* Format: 代码格式化
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant