Pyecharts全局配置项共有23小项,今天通过Pyecharts创建树图、图表和实例,具体了解“TitleOpts:标题配置项”的使用方法。

1、tree来实现:

实现代码:

from pyecharts import options as opts

from pyecharts.charts import Tree

data = [

{

"name": "TitleOpts:标题配置项",

"children":[

{

"name": "标题",

"children":[

{"name": "名称",

'children':[{"name": "title= '标题名称',"},

{"name": "title= '标题可通过\\n换行'"},

],

},

{"name": "链接",

'children':[{"name": "title_link= 'http://www.baidu.com'"},

],},

{"name": "链接跳转方式",

'children':[{"name": "title_targe=blank',"},

{"name": "title_targe=self"},

],

},

],

},

{

"name": "副标题",

"children":[

{"name": "名称",

'children':[{"name": "title= '副标题名称',"},

{"name": "title= '副标题可通过\\n换行'"},

],

},

{"name": "链接",

'children':[{"name": "title_link= 'http://www.baidu.com'"},

],},

{"name": "链接跳转方式",

'children':[{"name": "title_targe='blank',"},

{"name": "title_targe='self'"},

],

},

],

},

{

"name": "位置",

"children":[

{"name": "左","children":[{"name": "pos_left=20"},],},

{"name": "右","children":[{"name": "pos_right=20"},],},

{"name": "上","children":[{"name": "pos_top=20"},],},

{"name": "下","children":[{"name": "pos_bottom=20"},],},

],

},

{

"name": "间距",

"children":[

{"name": "内边距","children":[{"name": "padding= 5"},{"name": "padding= [50,50,50,50],"}],},

{"name": "主副间距","children":[{"name": "item_gap=10"},],},

],

},

{

"name": "字体样式",

"children":[

{"name": "标题字体样式","children":[{"name": "title_textstyle_opts= opts.TextStyleOpts(color=\"red\"),"},],},

{"name": "副标题字体样式","children":[{"name": "subtitle_textstyle_opts= opts.TextStyleOpts(color=\"blue\"),"},],},

],

},

],

}

]

c = (

Tree(init_opts=opts.InitOpts(width="1400px", height="800px", ))

.add("", data,is_roam= False,is_expand_and_collapse= False)

.set_global_opts(title_opts=opts.TitleOpts(title="TitleOpts:标题配置项",subtitle='.set_global_opts(title_opts=opts.TitleOpts())'))

)

c.render_notebook()

2、表格实现:

实现代码:

from pyecharts.components import Table

from pyecharts.options import ComponentTitleOpts

table = Table()

headers = ["属性", "代码", "说明",'举例']

rows = [

["TitleOpts()", 'title= None,','主标题文本,支持使用换行','title=\"标题配置项\"'],

["", 'title_link= None,', '主标题跳转 URL 链接','title_link=\'http://www.baidu.com\', '],

["", 'title_targe= None,','主标题跳转链接方式,默认值blank可选self和blank','title_target=None'],

["", 'subtitle= None,', '副标题文本,支持使用\\n 换行','subtitle=副标题'],

["", 'subtitle_link= None,', '副标题跳转 URL 链接','subtitle_link=\"http://www.baidu.com\"'],

["", 'subtitle_target= None,', '副标题跳转链接方式默认值是blank,可选self','subtitle_target=self'],

["", 'pos_left= None,', '标题离容器左侧的距离,使用数值,百分比或left, center, right','pos_left=\"20%\"'],

["", 'pos_right= None,', '标题离容器右侧的距离,使用数值,百分比或left, center, right','pos_right=\"20%\"'],

["", 'pos_top= None,', '标题离容器上侧的距离,使用数值,百分比或left, center, right','pos_top=\"20%\"'],

["", 'pos_bottom= None,', '标题离容器下侧的距离,使用数值,百分比或left, center, right','pos_bottom=\"20%\"'],

["", 'padding=5,', '标题内边距,单位px,默认各方向内边距为5,接受数组分别设定上右下左边距',' padding= 5 ,\npadding= [50,50,50,50],'],

["", 'item_gap=10,', '主副标题之间的间距',' item_gap=10'],

["", 'title_textstyle_opts= None,', '主标题字体样式配置项,参考 `series_options.TextStyleOpts`','title_textstyle_opts= opts.TextStyleOpts(color="red"),'],

["", 'subtitle_textstyle_opts= None,', '副标题字体样式配置项,参考 `series_options.TextStyleOpts`','subtitle_textstyle_opts= opts.TextStyleOpts(color="blue"),'],

]

table.add(headers, rows)

table.set_global_opts(title_opts=ComponentTitleOpts(title="TitleOpts:标题配置项表格",subtitle='.set_global_opts(title_opts=opts.TitleOpts())'))

table.render_notebook()

3、实例:

实现代码:

from pyecharts import options as opts

from pyecharts.charts import Bar

from pyecharts.faker import Faker

c = (

Bar()

.add_xaxis(Faker.choose())

.add_yaxis("商家A", Faker.values())

.add_yaxis("商家B", Faker.values())

.set_global_opts(

title_opts=opts.TitleOpts(

title= '主标题',

title_link= None,

title_target= None,

subtitle= '副标题',

subtitle_link= None,

subtitle_target= None,

pos_left= None,

pos_right= None,

pos_top=5,

pos_bottom= None,

padding= [5,10,5,10],

item_gap= 30,

title_textstyle_opts= opts.TextStyleOpts(color="red"),

subtitle_textstyle_opts= opts.TextStyleOpts(color="blue"),

)

)

)

c.render_notebook()

echarts设置标题样式_Pyecharts 全局配置项之标题配置项相关推荐

  1. html 设置统一样式,css 全局样式的定义

    对css还是不熟悉,老是对全局样式无从下手. 从网易拷了一份,学习了一下. body {margin:0; font:12px/1.5 \5b8b\4f53,Arial,sans-serif; bac ...

  2. 如何设置Office Word2003的一级与二级标题

    如何设置Word2003的一级与二级标题 1.选中文章中的所有一级标题: 2.在"格式"工具栏的左端,"样式"列表中单击"标题1". 仿照步 ...

  3. 在Word中为标题样式添加自动编号功能

    转自:http://blog.sina.com.cn/s/blog_6238dcdb0100qz8j.html 摘要: 本文可以帮助你在Office 2007中为Word标题样式添加和设置自动编号功能 ...

  4. html自定义序号样式,word设置自定义样式

    如何使用Word自定义样式生成目录 步骤/方法 1 首先搞清楚论文格式要CSS布局HTML小编今天和大家分享,比如格式要CSS布局HTML小编今天和大家分享如下: 论文统一用微软Word软件排版,16 ...

  5. 如何设置多级标题_办公技巧|标题样式amp;多级列表结合,再也不用手动修改1.1、1.2 ...!...

    每周一句 Accept the things you cannot change. Have the courage to change the things you can. 接受那些你也无法改变的 ...

  6. java poi 设置标题_poi生成Word时指定文本样式,如“正文”,“标题1”,“标题2”等...

    POI生成Word时,设置段落的样式 String style = "2"; //标题2的样式 XWPFParagraph xwpfParagraph = doc.insertNe ...

  7. Word 2003 标题样式设置

    在对一个论文排版时,有很多标题,通常还分为多个级别,如果我们一个一个的去设置格式去设置大纲级别的话,会浪费我们很多的时间,这里我们讨论一下样式的设置.样式,在word里我们可以理解为是格式的集合.在打 ...

  8. echarts 折现图和柱状图 样式修改 设置折线样式 背景(文末附带完整代码)

    1.设置折线图样式(修改后)(背景竖条纹间隔,去掉边框,设置折线和节点颜色,设置数据字体颜色) 设置折线样式: 设置折线图的背景样式: 2.设置柱状图样式(修改后) 设置柱子的样式 设置柱状图背景 完 ...

  9. 设置echarts 的网格样式颜色

    设置echarts的网格样式颜色 参考API文档:http://echarts.baidu.com/option.html#xAxis.splitLine option = {xAxis: {type ...

  10. echarts柱形图渐变样式设置

    1 问题描述 绘制柱形图时,单一的颜色往往不能满足需求,在这里就可以引用渐变的样式使整个页面看起来不那么单调. 2 算法描述 这里需要用到的是渐变内置生成器echarts.graphic.Linear ...

最新文章

  1. .NET Remoting中的通道注册
  2. 实例化servlet的几种方式
  3. mysql iops_MySQL实例IOPS使用率高的原因和解决方法
  4. 【转】关于LoadRunner的迭代
  5. JSON.parse()、eval()、JSON.stringify()、jQuery.parseJSON()的用法
  6. 你网络成瘾了吗 小心一堆怪病找上你
  7. Markdown编辑器常用功能以及快捷键介绍
  8. 新年第一天,3000台Apache服务器宕机
  9. WCF服务编程 学习笔记(1)
  10. 中国一线二线三线城市名单
  11. eclipse豆沙绿设置(一些其他的编辑器也变成豆沙绿)
  12. 技术中台的作用是什么,在什么情况下才有必要做技术中台?
  13. Project Server 2016 部署
  14. 如何在Windows上下载java
  15. Property description must be an object
  16. 如鱼饮水,冷暖自知。
  17. iOS咸鱼APP新特性界面-视频动画
  18. CodeBlock快捷键
  19. 程序猿看了要xiao了
  20. 普林斯顿算法课作业的python实现(四)8 Puzzle

热门文章

  1. 【Mac】nsurlsessiond 后台下载问题的解决方法
  2. JavaScript:Boolean对象
  3. 数据结构(三)树、二叉树、最优二叉树
  4. Python input和raw_input的区别
  5. easybcd添加或删除启动选项
  6. Oracle中常用的to_Char用法详解(有FMT的详细列表)
  7. 电能质量分析仪安装(access数据库版本 /WIN10系统) 出现
  8. HTML5与HTML4区别
  9. windows使用Charles手机抓包
  10. php . 和..,?php?和??