diff --git a/service/ExcelService.py b/service/ExcelService.py index 59b4f3e..5f700c2 100644 --- a/service/ExcelService.py +++ b/service/ExcelService.py @@ -11,12 +11,9 @@ class ExcelService(IFileService): pass def save(self, filePath, videoList): + filePath += ".xlsx" tttt.write_to_excel(videoList,filePath) tttt.calculate_ratio_and_update(filePath, 'Sheet') - import openpyxl - from openpyxl.chart import ScatterChart, BarChart, AreaChart, Reference - tttt.create_bar_chart(filePath,'Sheet') - texts = [ "approve", "money", @@ -24,8 +21,13 @@ class ExcelService(IFileService): "Stunning", "interaction" ] + tttt.write_english_texts(filePath, 'Sheet', texts) + tttt.create_bar_chart(filePath,'Sheet') + + + print("Data analysis written to the Excel file.") diff --git a/tool/tttt.py b/tool/tttt.py index f532191..e0a8d2d 100644 --- a/tool/tttt.py +++ b/tool/tttt.py @@ -88,8 +88,8 @@ if __name__ == '__main__': calculate_ratio_and_update(file_path, sheet_name) print("Data analysis written to the Excel file.") - import openpyxl - from openpyxl.chart import BarChart, Reference, AreaChart +import openpyxl +from openpyxl.chart import BarChart, Reference, AreaChart def create_bar_chart(file_name, sheet_name):