# _*_ coding: utf-8 _*_
"""
Time: 2021/12/29 12:45
Author: xiang_qu@huacenav.com
Version: V1.0
File: draw.py
Describe: 绘制圆饼图和柱状图
pyecharts: 0.1.9.4
"""
from pyecharts import Bar #导入柱状图
from pyecharts import Pie #导入饼图
class Draw():
def __init__(self):
self.bar = Bar
self.pie = Pie
def draw_bar(self, **kwargs):
#绘制柱状图
bar = self.bar(d1,d2)
bar.add(F1,x,y1,mark_line=["average"], mark_point=["max", "min"])
bar.add(F2,x,y2,mark_line=["average"], mark_point=["max", "min"])
bar.render()
def draw_pie(self, **kwargs):
#绘制圆饼图
pie = self.pie('\n'+ d1, d2)
pie.add(F1, x, y1, center=[25,60],is_label_show=True)
pie.add(F2, x, y2, center=[75,60],is_legend_show=True,is_label_show=True)
pie.render()
i
pyecharts绘制圆饼和柱状图,安排
最新推荐文章于 2024-08-03 19:27:22 发布
本文将介绍如何利用Python库pyecharts来创建具有吸引力的圆饼图和柱状图。pyecharts是一个强大的工具,它允许开发者在Python环境中方便地生成Echarts图表,为数据分析和可视化提供了便利。我们将详细讲解每个图表的创建步骤,包括数据准备、图表配置以及展示选项。通过实例,你可以轻松掌握pyecharts的基本用法。
摘要由CSDN通过智能技术生成