修复了图表不出现,以及被分析数据名不出现的bug,完美契合框架

Excel
芦笙 9 months ago
parent db42f2f9e7
commit 92af3260ef

@ -11,12 +11,9 @@ class ExcelService(IFileService):
pass pass
def save(self, filePath, videoList): def save(self, filePath, videoList):
filePath += ".xlsx"
tttt.write_to_excel(videoList,filePath) tttt.write_to_excel(videoList,filePath)
tttt.calculate_ratio_and_update(filePath, 'Sheet') tttt.calculate_ratio_and_update(filePath, 'Sheet')
import openpyxl
from openpyxl.chart import ScatterChart, BarChart, AreaChart, Reference
tttt.create_bar_chart(filePath,'Sheet')
texts = [ texts = [
"approve", "approve",
"money", "money",
@ -24,8 +21,13 @@ class ExcelService(IFileService):
"Stunning", "Stunning",
"interaction" "interaction"
] ]
tttt.write_english_texts(filePath, 'Sheet', texts) tttt.write_english_texts(filePath, 'Sheet', texts)
tttt.create_bar_chart(filePath,'Sheet')
print("Data analysis written to the Excel file.")

@ -88,8 +88,8 @@ if __name__ == '__main__':
calculate_ratio_and_update(file_path, sheet_name) calculate_ratio_and_update(file_path, sheet_name)
print("Data analysis written to the Excel file.") print("Data analysis written to the Excel file.")
import openpyxl import openpyxl
from openpyxl.chart import BarChart, Reference, AreaChart from openpyxl.chart import BarChart, Reference, AreaChart
def create_bar_chart(file_name, sheet_name): def create_bar_chart(file_name, sheet_name):

Loading…
Cancel
Save