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-документ успешно сохранен.", "Успех",