当前位置: 首页 > news >正文

安徽省建设厅官方网站网站编程培训学校有哪些

安徽省建设厅官方网站,网站编程培训学校有哪些,网推专员是做什么的,济南建设信用网网站2020年初#xff0c;很久没有用过pyecharts的我由于工作原因#xff0c;安装了新版pyecharts之后#xff0c;以前的pyecharts代码报错了。搜索之后才发现#xff0c;我安装的是不兼容旧版本的新版。空闲的时间#xff0c;把新版echart当作新的模块梳理了一下#xff0c;整…2020年初很久没有用过pyecharts的我由于工作原因安装了新版pyecharts之后以前的pyecharts代码报错了。搜索之后才发现我安装的是不兼容旧版本的新版。空闲的时间把新版echart当作新的模块梳理了一下整理为便于理解的形式。参考网址A Python Echarts Plotting Library这里描述了设置柱状图6大元素、柱状图转置XY轴、堆叠柱状图的方法。了解清楚了柱状图其他图形应该就无师自通啦框架结构都是一样的参数不同而已看一下文档就行啦~一、设置柱状图6大元素的方式6大元素为:标题、图例、X轴、Y轴、Y轴区域分隔线、数据标签首先导入需要的模块from 由于新版参数设置均已经选项配置化需要配置的选项都放在了配置项options里面因此需要导入options及使用到的图表。然后以下是基础代码框架bar1(Bar() ##定义为柱状图.add_xaxis([1,2,3]) ##X轴的值.add_yaxis(y值,[4,5,6],其他参数) ##y的值和y的一些数据配置项.set_global_opts(这里面配置一些 全局参数).set_series_opts(这里面配一些 系列参数) )bar1.render(bar1.html) ###输出html文件新版pyecharts可以采用以上的链式调用方式也可以采用bar1.add_xaxis()分开调用的方式。为了代码清晰并且看上去高大上一点哈哈~~建议采用链式调用。这6大元素参数在代码中分别进行配置的地方如下标题、图例、X轴、Y轴、Y轴区域分隔线为全局参数 在set_global_opts后面设置。数据标签为系列参数在set_series_opts后面设置。具体的简单示例为1.设置标题格式为.set_global_opts(title_optsopts.TitleOpts具体参数)具体参数细则参考TitleOpts的参数详情以下代码没有配置完所有参数网址直达A Python Echarts Plotting Librarybar1(Bar( ).add_xaxis([1月,2月,3月,4月,5月,6月,7月,8月,9月,10月,11月,12月]).add_yaxis(数量##系列的名称,[1000,2000,3000,5000,8000,3700,5800,7900,12000,10000,9000,8000] ##系列的数值).set_global_opts(title_optsopts.TitleOpts(title我是大标题,subtitle我是副标题,pos_left20% #标题的位置 距离左边20%距离。,item_gap10#主副标题之间的距离,title_textstyle_optsopts.TextStyleOpts(colorred#,font_size12,font_weightbold ) #大标题文字的格式配置,subtitle_textstyle_optsopts.TextStyleOpts(colorblue,font_stylenormal## 可选normalitalicoblique,font_weightnormal #粗细 normalboldbolderlighter ,font_family monospace# 还可以是 serif , monospace, Arial, Courier New, Microsoft YaHei, ...,font_size12,background_colorgrey#文字背景颜色,border_colorblack #文字块边框颜色)###小标题文字的格式配置)))bar1.render(bar1.html) ###输出html文件输出的格式为2.设置图例格式为.set_global_opts(legend_optsopts.LegendOpts具体参数)具体参数细则参考LegendOpts的参数详情以下代码没有配置完所有参数网址直达A Python Echarts Plotting Librarybar1(Bar( ).add_xaxis([1月,2月,3月,4月,5月,6月,7月,8月,9月,10月,11月,12月]).add_yaxis(数量##系列的名称,[1000,2000,3000,5000,8000,3700,5800,7900,12000,10000,9000,8000] ##系列的数值).set_global_opts(legend_optsopts.LegendOpts(type_None # plain普通图例。缺省就是普通图例。 # scroll可滚动翻页的图例。当图例数量较多时可以使用。 ,pos_leftright #图例横向的位置,right表示在右侧也可以为百分比,pos_topmiddle#图例纵向的位置middle表示中间也可以为百分比,orientvertical#horizontal #图例方式的方式)))bar1.render(bar1.html) ###输出html文件输出的格式为3.X轴设置格式为.set_global_opts(xaxis_optsopts.AxisOpts具体参数)具体参数细则参考AxisOpts的参数详情以下代码没有配置完所有参数网址直达A Python Echarts Plotting Librarybar1(Bar( ).add_xaxis([1月,2月,3月,4月,5月,6月,7月,8月,9月,10月,11月,12月]).add_yaxis(数量##系列的名称,[1000,2000,3000,5000,8000,3700,5800,7900,12000,10000,9000,8000] ##系列的数值).set_global_opts(xaxis_optsopts.AxisOpts(nameX轴名称,name_locationmiddle #坐标轴名字所在的位置,name_gap25#坐标轴名字与坐标轴之间的距离,name_rotate15 #坐标轴名字旋转角度,offset5 #坐标轴X的值距离X轴的距离,name_textstyle_optsopts.TextStyleOpts(colorblack,font_styleitalic## 可选normalitalicoblique,font_weightbolder #粗细 normalboldbolderlighter ,font_family monospace# 还可以是 serif , monospace, Arial, Courier New, Microsoft YaHei, ...,font_size14,background_colorgrey#文字背景颜色,border_colorblack #文字块边框颜色)##X轴名称的格式配置,axistick_optsopts.AxisTickOpts(is_insideTrue #刻度线是否在内侧) #坐标轴刻度配置项,axisline_optsopts.AxisLineOpts(linestyle_optsopts.LineStyleOpts(width3 ##设置宽度,opacity0 #设置透明度,type_dashed # solid, dashed, dotted,colorblack) )#坐标轴线的配置项,axislabel_optsopts.LabelOpts(font_size13#字的大小,rotate15 #字旋转的角度)##坐标轴标签的格式配置)))bar1.render(bar1.html) ###输出html文件输出格式为4.Y轴、Y轴分割线的设置y轴配置和X轴的类似。格式为.set_global_opts(yaxis_optsopts.AxisOpts具体参数bar1(Bar( ).add_xaxis([1月,2月,3月,4月,5月,6月,7月,8月,9月,10月,11月,12月]).add_yaxis(数量##系列的名称,[1000,2000,3000,5000,8000,3700,5800,7900,12000,10000,9000,8000] ##系列的数值).set_global_opts(yaxis_optsopts.AxisOpts(nameY轴名称,name_locationmiddle #坐标轴名字所在的位置,name_gap25#坐标轴名字与坐标轴之间的距离,name_rotate60 #坐标轴名字旋转角度,name_textstyle_optsopts.TextStyleOpts(colorblack,font_styleitalic## 可选normalitalicoblique,font_weightbolder #粗细 normalboldbolderlighter ,font_family monospace# 还可以是 serif , monospace, Arial, Courier New, Microsoft YaHei, ...,font_size14,background_colorgrey#文字背景颜色,border_colorblack #文字块边框颜色),offset5 #y轴相对于默认位置偏移的距离相同位置有多个y轴时可以用到,split_number5 #坐标轴分割的段数默认为5只是预估不是实际展示的段数,min_0 #最小时候,max_20000 #最大值,splitline_optsopts.SplitLineOpts(is_showTrue # 是否展示Y轴分割线,linestyle_optsopts.LineStyleOpts(width1 ##设置宽度,opacity0.5 #设置透明度,type_dotted # solid, dashed, dotted,colorgrey ) )# y轴分割线显示的相关设置,X轴和y轴都有, axisline_optsopts.AxisLineOpts(linestyle_optsopts.LineStyleOpts(width3 ##设置宽度# ,opacity0 #设置透明度,type_dashed # solid, dashed, dotted,colorred ) )###坐标轴线的配置项# ,splitarea_opts ##分割区域配置项)) )bar1.render(bar1.html) ###输出html文件输出格式为5.数据标签格式为.set_series_opts(label_optsopts.LabelOpts(具体参数)具体参数细则参考LabelOpts的参数详情以下代码没有配置完所有参数网址直达A Python Echarts Plotting Librarybar1(Bar( ).add_xaxis([1月,2月,3月,4月,5月,6月,7月,8月,9月,10月,11月,12月]).add_yaxis(数量##系列的名称,[1000,2000,3000,5000,8000,3700,5800,7900,12000,10000,9000,8000] ##系列的数值).set_series_opts(label_optsopts.LabelOpts(positioninsideTop #设置数据标签所在的位置 topleftrightbottominsideinsideLeftinsideRight# insideTopinsideBottom insideTopLeftinsideBottomLeft# insideTopRightinsideBottomRight,colorwhite#数据标签的颜色,font_size12 # ,formatter #数据标签显示格式)##设置数据标签的格式s) )bar1.render(bar1.html) ###输出html文件输出格式为opts.LabelOpts()在代码中都有重复出现这个配置项可以使用来设置标签格式的包括X轴的标签、Y轴的标签、数据标签。配置逻辑有差异如下x和y轴配置标签的逻辑为设置全局配置项→设置x轴/y轴的配置项→设置轴标签的配置项→使用opts.LabelOpts()进行配置。数据标签配置标签的逻辑为设置系列配置项→设置标签配置项→使用opts.LabelOpts()进行配置总结将以上的代码汇总在一起得到以下的图形代码奉上bar1(Bar( ).add_xaxis([1月,2月,3月,4月,5月,6月,7月,8月,9月,10月,11月,12月]).add_yaxis(数量##系列的名称,[1000,2000,3000,5000,8000,3700,5800,7900,12000,10000,9000,8000] ##系列的数值).set_global_opts(title_optsopts.TitleOpts(title我是大标题,subtitle我是副标题,pos_left45% #标题的位置 距离左边20%距离。,item_gap15#主副标题之间的距离,title_textstyle_optsopts.TextStyleOpts(colorred,font_size17,font_weightbold ) #大标题的格式配置,subtitle_textstyle_optsopts.TextStyleOpts(colorblue,font_stylenormal## 可选normalitalicoblique,font_weightnormal #粗细 normalboldbolderlighter ,font_family monospace# 还可以是 serif , monospace, Arial, Courier New, Microsoft YaHei, ...,font_size12,background_colorgrey#文字背景颜色,border_colorblack #文字块边框颜色)),legend_optsopts.LegendOpts(type_None # plain普通图例。缺省就是普通图例。 # scroll可滚动翻页的图例。当图例数量较多时可以使用。 ,pos_leftright #图例横向的位置,pos_topmiddle#图例纵向的位置,orientvertical#horizontal #图例方式的方式), xaxis_optsopts.AxisOpts(nameX轴名称,name_locationmiddle #坐标轴名字所在的位置,name_gap25#坐标轴名字与坐标轴之间的距离,name_rotate15 #坐标轴名字旋转角度,offset5 #坐标轴X的值距离X轴的距离,name_textstyle_optsopts.TextStyleOpts(colorblack,font_styleitalic## 可选normalitalicoblique,font_weightbolder #粗细 normalboldbolderlighter ,font_family monospace# 还可以是 serif , monospace, Arial, Courier New, Microsoft YaHei, ...,font_size14,background_colorgrey#文字背景颜色,border_colorblack #文字块边框颜色),axistick_optsopts.AxisTickOpts(is_insideTrue #刻度线是否在内侧) #坐标轴刻度配置项,axisline_optsopts.AxisLineOpts(linestyle_optsopts.LineStyleOpts(width3 ##设置宽度#,opacity0 #设置透明度,type_dashed # solid, dashed, dotted,colorblack ) )###坐标轴线的配置项,axislabel_optsopts.LabelOpts(font_size13,rotate15)##坐标轴标签的配置项),yaxis_optsopts.AxisOpts(nameY轴名称,name_locationmiddle #坐标轴名字所在的位置,name_gap25#坐标轴名字与坐标轴之间的距离,name_rotate60 #坐标轴名字旋转角度,name_textstyle_optsopts.TextStyleOpts(colorblack,font_styleitalic## 可选normalitalicoblique,font_weightbolder #粗细 normalboldbolderlighter ,font_family monospace# 还可以是 serif , monospace, Arial, Courier New, Microsoft YaHei, ...,font_size14,background_colorgrey#文字背景颜色,border_colorblack #文字块边框颜色),offset5 #y轴相对于默认位置偏移的距离相同位置有多个y轴时可以用到,split_number5 #坐标轴分割的段数默认为5只是预估不是实际展示的段数,min_0 #最小时候,max_20000 #最大值,splitline_optsopts.SplitLineOpts(is_showTrue # 是否展示Y轴分割线,linestyle_optsopts.LineStyleOpts(width1 ##设置宽度,opacity0.5 #设置透明度,type_dotted # solid, dashed, dotted,colorgrey ) )# y轴分割线显示的相关设置,X轴和y轴都有, axisline_optsopts.AxisLineOpts(linestyle_optsopts.LineStyleOpts(width3 ##设置宽度# ,opacity0 #设置透明度,type_dashed # solid, dashed, dotted,colorred ) )###坐标轴线的配置项# ,splitarea_opts ##分割区域配置项)).set_series_opts(label_optsopts.LabelOpts(positioninsideTop #设置数据标签所在的位置 topleftrightbottominsideinsideLeftinsideRight# insideTopinsideBottom insideTopLeftinsideBottomLeft# insideTopRightinsideBottomRight,colorwhite#数据标签的颜色,font_size12 # ,formatter #数据标签显示格式)##设置数据标签的格式s))bar1.render(bar1.html) ###输出html文件二、转置XY轴调用方式很简单为 .reversal_axis()bar1(Bar( ).add_xaxis([1月,2月,3月,4月,5月,6月,7月,8月,9月,10月,11月,12月]).add_yaxis(数量##系列的名称,[1000,2000,3000,5000,8000,3700,5800,7900,12000,10000,9000,8000] ##系列的数值).set_series_opts(label_optsopts.LabelOpts(positionright #设置数据标签所在的位置topleftrightbottominsideinsideLeftinsideRight# insideTopinsideBottom insideTopLeftinsideBottomLeft# insideTopRightinsideBottomRight,font_size12 # ,formatter #数据标签显示格式)##设置数据标签的格式s).reversal_axis())bar1.render(bar1.html) ###输出html文件输出格式为三、堆叠柱状图格式为.add_yaxis(具体参数)具体参数中stack参数设置一个字符串。多个.add_yaxis()时stack的值为一样的y值就会叠加在一起。代码示例如下两个.add_yaxis的stack值都为“stack1”,所以就堆叠在一起了。bar1(Bar( ).add_xaxis([1月,2月,3月,4月,5月,6月,7月,8月,9月,10月,11月,12月]).add_yaxis(甲的数量##系列的名称,[1000,2000,3000,5000,8000,3700,5800,7900,12000,10000,9000,8000] ##系列的数值,stackstack1).add_yaxis(已的数量##系列的名称,[500,1000,588,5788,6000,5677,3467,4444,3333,6666,7777,8888] ##系列的数值,stackstack1).set_global_opts(title_optsopts.TitleOpts(title堆叠的柱状图,pos_left45%),legend_optsopts.LegendOpts(type_None # plain普通图例。缺省就是普通图例。 # scroll可滚动翻页的图例。当图例数量较多时可以使用。 ,pos_leftright #图例横向的位置,pos_topmiddle#图例纵向的位置,orientvertical#horizontal #图例方式的方式)).set_series_opts(label_optsopts.LabelOpts(is_showFalse ##不显示数据标签)) )bar1.render(bar1.html) ###输出html文件输出格式为
http://www.pierceye.com/news/597654/

相关文章:

  • 广东省石油化工建设集团公司网站炫酷个人网站
  • 石家庄模板建站代理什么网站可以自己做字
  • 公司想做个网站应该怎么做河南郑州网站设计公司
  • 建电影网站赚钱挣钱吗网站互动功能
  • 流浪动物网站开发巴中手机网站建设
  • 吕梁网站建设kuyiso手机网站建设 jz.woonl
  • 电脑和手机都能浏览的网站开发设计学类包括哪些专业
  • 网站规划与建设评分标准网站中竖导航栏怎么做
  • 网站备案规定周到的商城网站建设
  • 考幼师证去哪个网站做试题如何分析网站建设
  • 济南智能网站建设哪家好化工网站建设推广
  • 福州 网站定制设计稿定设计官方免费下载
  • 统计局网站建设情况南宁做网站优化的公司
  • 免费的软件网站建设北京建设厅网站查询
  • 没有公司做网站短网址短链接生成器
  • 利于seo优化的网站网站怎么上传到空间
  • 寿阳网站建设开发网站的硬件成本
  • 做网站的叫什么软件众筹网站开发
  • 鲜花网网站开发的目标河南郑州建设网站
  • 做网站上哪买空间帝国网站管理系统安装连接不上数据库
  • 做前端网站用什么工具网站备案后怎么做实名认证
  • 做兼职那个网站比较好重庆的seo服务公司
  • 网站建设流费用南通seo排名公司
  • 河北邢台移动网站建设单片机做网站
  • 佛山网站制作的公司做文库网站怎么赚钱吗
  • 博客网站 做淘宝客咸阳网站建设推广
  • 佛山手机网站建设优化做网站要多大的画布
  • 网站结构优化包括什么网站建设定制开发
  • 做装修的有那些网站wordpress获取用户位置
  • 找事做网站公司网站网页设计