page grid layout

1. Make the chart vertical layout-Page

  1. First import the class
from pyecharts.charts import Page, Grid
  1. Instantiate it when you use it.
    It needs to be pointed out that Page()parameters can be specified during initialization . For example layout, DraggablePageLayouteach module can be dragged and zoomed arbitrarily to facilitate manual layout; and each module can be SimplePageLayoutautomatically aligned horizontally. If not specified, all modules will be aligned to the left.
page_1 = Page(layout=Page.SimplePageLayout)     
 #page布局   layout=Page.DraggablePageLayout   layout=Page.SimplePageLayout
  1. Add things to the page.
grid1_1 = Grid(init_opts=opts.InitOpts(theme=ThemeType.ROMA, width='1600px'))

c1_1 = phone_views.huozan_mi()
c1_2 = phone_views.huozan_honor()
grid1_1.add(c1_1, grid_opts=opts.GridOpts(pos_right="55%"))
grid1_1.add(c1_2, grid_opts=opts.GridOpts(pos_left="55%"))
# 对grid的pos参数而言,pos_left是显示在靠右的位置 pos_right同理

im1 = phone_views.image_mi10_fea

Guess you like

Origin blog.csdn.net/zhaoyangjian724/article/details/112014719