地理坐标Geo部分学习

[1] class pyecharts.charts.Geo

geo=Geo() 为画出地图背景 不做设置即为空白背景

[2]func pyecharts.charts.Geo.add_schema

[3]func pyecharts.charts.Geo.add

  1. def add(
  2. # 系列名称,用于 tooltip 的显示,legend 的图例筛选。
  3. series_name: str,
  4. # 数据项 (坐标点名称,坐标点值)
  5. data_pair: Sequence,
  6. # Geo 图类型,有 scatter, effectScatter, heatmap, lines 4 种,建议使用
  7. # from pyecharts.globals import GeoType
  8. # GeoType.GeoType.EFFECT_SCATTER,GeoType.HEATMAP,GeoType.LINES
  9. type_: str = "scatter",
  10. # 是否选中图例
  11. is_selected: bool = True,
  12. # 标记图形形状
  13. symbol: Optional[str] = None,
  14. # 标记的大小
  15. symbol_size: Numeric = 12,
  16. # 每个点的大小,在地理坐标系(coordinateSystem: 'geo')上有效。
  17. blur_size: types.Numeric = 20,
  18. # 每个点模糊的大小,在地理坐标系(coordinateSystem: 'geo')上有效。
  19. point_size: types.Numeric = 20,
  20. # 系列 label 颜色
  21. color: Optional[str] = None,
  22. # 是否是多段线,在画 lines 图情况下
  23. is_polyline: bool = False,
  24. # 是否启用大规模线图的优化,在数据图形特别多的时候(>=5k)可以开启
  25. is_large: bool = False,
  26. # 特效尾迹的长度。取从 0 到 1 的值,数值越大尾迹越长。默认值 0.2
  27. trail_length: Numeric = 0.2,
  28. # 开启绘制优化的阈值。
  29. large_threshold: Numeric = 2000,
  30. # 配置该系列每一帧渲染的图形数
  31. progressive: types.Numeric = 400,
  32. # 启用渐进式渲染的图形数量阈值,在单个系列的图形数量超过该阈值时启用渐进式渲染。
  33. progressive_threshold: types.Numeric = 3000,
  34. # 标签配置项,参考 `series_options.LabelOpts`
  35. label_opts: Union[opts.LabelOpts, dict] = opts.LabelOpts(),
  36. # 涟漪特效配置项,参考 `series_options.EffectOpts`
  37. effect_opts: Union[opts.EffectOpts, dict] = opts.EffectOpts(),
  38. # 线样式配置项,参考 `series_options.LineStyleOpts`
  39. linestyle_opts: Union[opts.LineStyleOpts, dict] = opts.LineStyleOpts(),
  40. # 提示框组件配置项,参考 `series_options.TooltipOpts`
  41. tooltip_opts: Union[opts.TooltipOpts, dict, None] = None,
  42. # 图元样式配置项,参考 `series_options.ItemStyleOpts`
  43. itemstyle_opts: Union[opts.ItemStyleOpts, dict, None] = None,
  44. # 这个配置相对非常复杂(参照地址: https://www.echartsjs.com/zh/option.html#series-custom.renderItem)
  45. render_item: types.JsCode = None,
  46. # 这个配置相对非常复杂(参照地址: https://www.echartsjs.com/zh/option.html#series-custom.encode)
  47. encode: types.Union[types.JsCode, dict] = None,
  48. )