用ChatGPT 4o画漂亮的燃尽图代码

2024-06-13 13:12
文章标签 chatgpt 代码 ai 漂亮 燃尽 4o

本文主要是介绍用ChatGPT 4o画漂亮的燃尽图代码,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

把代码给ChatGPT,然后他就会帮我生成出来了。

而且图是动态的,可以调整颜色文字之类的内容

# Given data for Sprint 5 Progress
data_sprint_5 = {'User Story': ['BEAN-40', 'BEAN-42', 'BEAN-41', 'BEAN-22', 'BEAN-33', 'BEAN-44', 'BEAN-10', 'BEAN-26', 'BEAN-37', 'BEAN-36', 'BEAN-14', 'BEAN-39', 'BEAN-17', 'BEAN-38', 'BEAN-29', 'BEAN-9'],'Task': ['Build Test Framework Base on Python','Final Report','Summary Reports','As a staff member, I want to be able to send and receive messages so that I can communicate effectively with the customers and the managers','As a manager, I want to be able to send and receive messages so that I can communicate effectively with the customers and the managers','Design Test Cases','As a customer, I want to provide feedback on menu items so that I can contribute to improving the menu and share my experiences with the business','As a manager, I want to manage a points-based rewards system so that I can engage customers and drive sales','Should display the estimated preparation time, When selecting the option for immediate pickup','Add multiple quantities of the same item from the product page!','As a customer, I want to be able to send and receive messages so that I can communicate effectively with the staff members','Design Test Framework and Strategy','As a customer, I want to view and manage my points-based rewards section so that I can manage my points','Error info when click booking button','As a manager, I want to view management reports to gain insights into customer behaviour and preferences so that I can take informed business decisions','As a customer, I want to view my past orders so that I can easily reorder favourite items and track my purchase history'],'Developer': ['Cedar', 'Cedar', 'Cedar', 'Luke, Arjun', 'Luke, Arjun', 'Luke, Arjun', 'Luke, Arjun', 'Luke, Arjun', 'Luke, Arjun', 'Luke, Arjun', 'Luke, Arjun', 'Luke, Arjun', 'Luke, Arjun', 'Luke, Arjun', 'Luke, Arjun', 'Luke, Arjun'],'Estimated Hours': [10, 10, 10, 11, 9, 9, 12, 9, 12, 10, 5, 5, 5, 5, 5, 5]
}# Create a DataFrame from the given data
sprint_5_df = pd.DataFrame(data_sprint_5)# Dates for the sprint
dates_sprint_5 = pd.date_range(start="2024-06-05", end="2024-06-10")# Initialize remaining hours with total estimated hours at the start of the sprint
total_hours_sprint_5 = sprint_5_df['Estimated Hours'].sum()
remaining_hours_sprint_5 = total_hours_sprint_5
actual_burndown_sprint_5 = [remaining_hours_sprint_5]# Update remaining hours only when a task is completed
for i, row in sprint_5_df.iterrows():# For this example, assume all tasks are completedremaining_hours_sprint_5 -= row['Estimated Hours']actual_burndown_sprint_5.append(remaining_hours_sprint_5)# Extend the actual burndown to match the length of the dates if needed
while len(actual_burndown_sprint_5) < len(dates_sprint_5) + 1:actual_burndown_sprint_5.append(remaining_hours_sprint_5)# Ideal burndown calculation
ideal_burndown_sprint_5 = [total_hours_sprint_5 - (total_hours_sprint_5 / len(dates_sprint_5)) * i for i in range(len(dates_sprint_5))]# Ensure the lengths are the same for plotting
if len(actual_burndown_sprint_5) > len(dates_sprint_5) + 1:actual_burndown_sprint_5 = actual_burndown_sprint_5[:len(dates_sprint_5) + 1]# Plotting the Burndown Chart
plt.figure(figsize=(10, 6))
plt.plot(dates_sprint_5, ideal_burndown_sprint_5, label='Ideal Burn Down', linestyle='--')
plt.plot(dates_sprint_5.insert(0, dates_sprint_5[0] - pd.Timedelta(days=1)), actual_burndown_sprint_5, label='Remaining Effort', marker='o')
plt.xlabel('Date')
plt.ylabel('Hours Remaining')
plt.title('Sprint 5 Burndown Chart')
plt.legend()
plt.grid(True)
plt.xticks(dates_sprint_5, rotation=45)
plt.yticks(range(0, total_hours_sprint_5 + 1, 5))
plt.tight_layout()plt.show()

调整后的图

这篇关于用ChatGPT 4o画漂亮的燃尽图代码的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1057397

相关文章

springboot循环依赖问题案例代码及解决办法

《springboot循环依赖问题案例代码及解决办法》在SpringBoot中,如果两个或多个Bean之间存在循环依赖(即BeanA依赖BeanB,而BeanB又依赖BeanA),会导致Spring的... 目录1. 什么是循环依赖?2. 循环依赖的场景案例3. 解决循环依赖的常见方法方法 1:使用 @La

使用C#代码在PDF文档中添加、删除和替换图片

《使用C#代码在PDF文档中添加、删除和替换图片》在当今数字化文档处理场景中,动态操作PDF文档中的图像已成为企业级应用开发的核心需求之一,本文将介绍如何在.NET平台使用C#代码在PDF文档中添加、... 目录引言用C#添加图片到PDF文档用C#删除PDF文档中的图片用C#替换PDF文档中的图片引言在当

C#使用SQLite进行大数据量高效处理的代码示例

《C#使用SQLite进行大数据量高效处理的代码示例》在软件开发中,高效处理大数据量是一个常见且具有挑战性的任务,SQLite因其零配置、嵌入式、跨平台的特性,成为许多开发者的首选数据库,本文将深入探... 目录前言准备工作数据实体核心技术批量插入:从乌龟到猎豹的蜕变分页查询:加载百万数据异步处理:拒绝界面

用js控制视频播放进度基本示例代码

《用js控制视频播放进度基本示例代码》写前端的时候,很多的时候是需要支持要网页视频播放的功能,下面这篇文章主要给大家介绍了关于用js控制视频播放进度的相关资料,文中通过代码介绍的非常详细,需要的朋友可... 目录前言html部分:JavaScript部分:注意:总结前言在javascript中控制视频播放

Spring Boot 3.4.3 基于 Spring WebFlux 实现 SSE 功能(代码示例)

《SpringBoot3.4.3基于SpringWebFlux实现SSE功能(代码示例)》SpringBoot3.4.3结合SpringWebFlux实现SSE功能,为实时数据推送提供... 目录1. SSE 简介1.1 什么是 SSE?1.2 SSE 的优点1.3 适用场景2. Spring WebFlu

java之Objects.nonNull用法代码解读

《java之Objects.nonNull用法代码解读》:本文主要介绍java之Objects.nonNull用法代码,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐... 目录Java之Objects.nonwww.chinasem.cnNull用法代码Objects.nonN

SpringBoot实现MD5加盐算法的示例代码

《SpringBoot实现MD5加盐算法的示例代码》加盐算法是一种用于增强密码安全性的技术,本文主要介绍了SpringBoot实现MD5加盐算法的示例代码,文中通过示例代码介绍的非常详细,对大家的学习... 目录一、什么是加盐算法二、如何实现加盐算法2.1 加盐算法代码实现2.2 注册页面中进行密码加盐2.

python+opencv处理颜色之将目标颜色转换实例代码

《python+opencv处理颜色之将目标颜色转换实例代码》OpenCV是一个的跨平台计算机视觉库,可以运行在Linux、Windows和MacOS操作系统上,:本文主要介绍python+ope... 目录下面是代码+ 效果 + 解释转HSV: 关于颜色总是要转HSV的掩膜再标注总结 目标:将红色的部分滤

在C#中调用Python代码的两种实现方式

《在C#中调用Python代码的两种实现方式》:本文主要介绍在C#中调用Python代码的两种实现方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录C#调用python代码的方式1. 使用 Python.NET2. 使用外部进程调用 Python 脚本总结C#调

基于Flask框架添加多个AI模型的API并进行交互

《基于Flask框架添加多个AI模型的API并进行交互》:本文主要介绍如何基于Flask框架开发AI模型API管理系统,允许用户添加、删除不同AI模型的API密钥,感兴趣的可以了解下... 目录1. 概述2. 后端代码说明2.1 依赖库导入2.2 应用初始化2.3 API 存储字典2.4 路由函数2.5 应