ybc_echarts模块(数据可视化模块)

Geo( title, subtitle, title_pos, width, height )

功能

创建一个地图

参数

·title:地图主标题
·subtitle:地图副标题
·title_pos:标题的排列方式
·width:地图的宽度
·height:地图的高度

返回值

地图对象

例子

import ybc_echarts

geo = ybc_echarts.Geo('地图主标题',
                      '地图副标题',
                      title_pos = 'center',
                      width = 1600,
                      height = 800)
print(geo)

地图对象.add( attr, value, geo_cities_coords )

功能

在地图中添加数据

参数

·attr:地址(列表/元组)
·value:地址对应的数据(列表/元组)
·geo_cities_coords:地址对应的坐标(列表/元组)

返回值

例子

import ybc_echarts

geo = ybc_echarts.Geo('地图主标题',
                      '地图副标题',
                      title_pos = 'center',
                      width = 1600,
                      height = 800)
geo.add(['北京朝阳','吉林长春'],
        [7,2],
        geo_cities_coords = {'北京朝阳':[116.44,39.92],
                             '吉林长春':[125.32,43.9]})
geo.render()

地图对象.render( path )

功能

生成地图图表网页

参数

·path:网页的名字(可以省略不写,默认是render.html)

返回值

例子

import ybc_echarts

geo = ybc_echarts.Geo('地图主标题',
                      '地图副标题',
                      title_pos = 'center',
                      width = 1600,
                      height = 800)
geo.add(['北京朝阳','吉林长春'],
        [7,2],
        geo_cities_coords = {'北京朝阳':[116.44,39.92],
                             '吉林长春':[125.32,43.9]})
geo.render('my.html')