pyecharts/example/image_example.py
陈键冬 1fcd9157da Components (#1127)
* Add: Table 类提供标题设置 新增 Image 类

* Format: code

* Update: page_title 设置为全局变量
2019-05-18 16:52:25 +01:00

22 lines
602 B
Python

from pyecharts.components import Image
from pyecharts.options import ComponentTitleOpts
def image_base() -> Image:
image = Image()
img_src = (
"https://user-images.githubusercontent.com/19553554/396123"
"58-499eb2ae-4f91-11e8-8f56-179c4f0bf2df.png"
)
image.add(
src=img_src,
style_opts={"width": "200px", "height": "200px", "style": "margin-top: 20px"},
).set_global_opts(
title_opts=ComponentTitleOpts(title="我是主标题", subtitle="我是副标题支持换行哦")
)
return image
image_base().render()