From 3df672c516a15e7725deb4728d728bcf5bb81d76 Mon Sep 17 00:00:00 2001 From: maxnes3 <112558334+maxnes3@users.noreply.github.com> Date: Thu, 2 Nov 2023 09:16:50 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=D0=B5?= =?UTF-8?q?=D1=82=20=D0=94=D0=B8=D0=B0=D0=B3=D1=80=D0=B0=D0=BC=D0=BC=D0=B0?= =?UTF-8?q?=20=D0=90=D1=80=D1=82=D1=91=D0=BC=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WinForm/AppView/AppView.csproj | 1 + WinForm/AppView/FormMain.cs | 32 +++++++++++++------------------- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/WinForm/AppView/AppView.csproj b/WinForm/AppView/AppView.csproj index d4b9c57..793bad2 100644 --- a/WinForm/AppView/AppView.csproj +++ b/WinForm/AppView/AppView.csproj @@ -11,6 +11,7 @@ + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/WinForm/AppView/FormMain.cs b/WinForm/AppView/FormMain.cs index dd118c5..c40486e 100644 --- a/WinForm/AppView/FormMain.cs +++ b/WinForm/AppView/FormMain.cs @@ -19,6 +19,9 @@ using System.Windows.Forms; using System.Windows.Forms.VisualStyles; using PdfFormsLibrary; using PdfFormsLibrary.Helpers; +using WinFormsLibrary.SupportClasses; +using WinFormsLibrary.SupportClasses.Enums; +using DataBaseImplement.Models; namespace AppView { @@ -96,10 +99,7 @@ namespace AppView } } - private void AddProviderItem_Click( - object sender, - EventArgs e - ) + private void AddProviderItem_Click(object sender, EventArgs e) { var service = Program.ServiceProvider?.GetService(typeof(FormProvider)); if (service is FormProvider form) @@ -258,34 +258,28 @@ namespace AppView Count = (double)group.Count(), }); - var resultData = new List<(int, double)>(); + List results = new(); + List names = new(); foreach (var provider in providersList) { - resultData.Add((DateTime.Now.Year, provider.Count)); + results.Add(provider.Count); + names.Add(provider.Type); } - ComponentDocumentWithChartConfig config = new() - { - ChartTitle = "Количество поставщиков в разрезе типа организации", - LegendLocation = ComponentsLibraryNet60.Models.Location.Bottom, - Header = "Круговая диаграмма", - Data = new() - { - { "Тип организации", resultData }, - }, - }; - SaveFileDialog saveFileDialog = new() { Filter = "Word Files|*.docx" }; if (saveFileDialog.ShowDialog() == DialogResult.OK) { - config.FilePath = saveFileDialog.FileName; + SimpleCircleDiagram simpleCircleDiagram = new(saveFileDialog.FileName, "Круговая диаграмма", "Количество поставщиков в разрезе типа организации", + EnumAreaLegend.Right, new() { new DataCircleDiagram("Типы организации", results.ToArray()) }); + simpleCircleDiagram.NameData = names.ToArray(); try { - componentDocumentWithChartPieWord.CreateDoc(config); + //componentDocumentWithChartPieWord.CreateDoc(config); + circleDiagram.AddCircleDiagram(simpleCircleDiagram); MessageBox.Show( "Word-документ успешно сохранен.", "Успех",