This commit is contained in:
Леонид Малафеев 2024-10-22 22:16:45 +04:00
parent 21fc0e3e1d
commit f6c9b56bb1
8 changed files with 13 additions and 21 deletions

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework> <TargetFramework>net8.0-windows7.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>

View File

@ -48,12 +48,9 @@ namespace Controls
Chart chart = new Chart(ChartType.Line); Chart chart = new Chart(ChartType.Line);
//Задание легенды
chart.Legend.Docking = (DockingType)legendAlign; chart.Legend.Docking = (DockingType)legendAlign;
chart.Legend.LineFormat.Visible = true; chart.Legend.LineFormat.Visible = true;
//Добавление серий
foreach (var item in data) foreach (var item in data)
{ {
Series series = chart.SeriesCollection.AddSeries(); Series series = chart.SeriesCollection.AddSeries();
@ -67,7 +64,6 @@ namespace Controls
series.Add(vals); series.Add(vals);
} }
//Объявление осей
chart.XAxis.MajorTickMark = TickMarkType.Outside; chart.XAxis.MajorTickMark = TickMarkType.Outside;
chart.YAxis.MajorTickMark = TickMarkType.Outside; chart.YAxis.MajorTickMark = TickMarkType.Outside;
chart.YAxis.HasMajorGridlines = true; chart.YAxis.HasMajorGridlines = true;

View File

@ -55,21 +55,17 @@ namespace Controls
_section = _document.AddSection(); _section = _document.AddSection();
//Заголовок
var paragraph = _section.AddParagraph(title); var paragraph = _section.AddParagraph(title);
paragraph.Format.SpaceAfter = "0.3cm"; paragraph.Format.SpaceAfter = "0.3cm";
//Создание таблицы
var table = _section.AddTable(); var table = _section.AddTable();
table.Borders.Visible = true; table.Borders.Visible = true;
//Создание колонок
for (int i = 0; i < colInfo.Count; i++) for (int i = 0; i < colInfo.Count; i++)
{ {
table.AddColumn(colInfo[i].Width); table.AddColumn(colInfo[i].Width);
} }
//Создание строк
if (mergeCells != null) if (mergeCells != null)
{ {
table.AddRow(); table.AddRow();
@ -83,7 +79,6 @@ namespace Controls
List<int> MergeColls = new List<int>(); List<int> MergeColls = new List<int>();
//Объединение ячеек в строке
if (mergeCells != null) if (mergeCells != null)
{ {
foreach (var cell in mergeCells) foreach (var cell in mergeCells)
@ -96,8 +91,6 @@ namespace Controls
int cellsCount = table.Rows[1].Cells.Count; int cellsCount = table.Rows[1].Cells.Count;
//Объединение ячеек в столбце
if (MergeColls.Count != 0) if (MergeColls.Count != 0)
{ {
for (int i = 0; i < cellsCount; i++) for (int i = 0; i < cellsCount; i++)
@ -111,8 +104,6 @@ namespace Controls
} }
} }
//Вывод данных в таблицу в файл
int rowData = 2; int rowData = 2;
foreach (var item in data) foreach (var item in data)

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -24,9 +24,12 @@ namespace Forms
private void buttonLargeText_CLick(object sender, EventArgs e) private void buttonLargeText_CLick(object sender, EventArgs e)
{ {
string[] strings = new string[] { "aboba", "not aboba", "best aboba" }; string[] strings = new string[] { "aboba",
LargeTextComponent largeText = new LargeTextComponent(); "тут я пишу супер много текста( ну или не супер много ) для сдачи",
largeText.CreateDocument("C:\\Ulstu\\COP\\Cop_25\\Controls\\docs\\text.pdf", "OMEGA LABA 2", strings); "best aboba",
"гружу сюда супер большой тексттттт" };
largeTextComponent1.CreateDocument("C:\\Ulstu\\COP\\Cop_25\\Controls\\docs\\text.pdf",
"OMEGA LABA 2", strings);
} }
private void buttonCreateTable_Click(object sender, EventArgs e) private void buttonCreateTable_Click(object sender, EventArgs e)
@ -40,7 +43,7 @@ namespace Forms
List<MergeCells> mergeCells = new List<MergeCells>() List<MergeCells> mergeCells = new List<MergeCells>()
{ {
new MergeCells("Данные", new int[] {0,1,3}) new MergeCells("Данные", new int[] {0,2,2})
}; };
List<Person> people = new List<Person>() List<Person> people = new List<Person>()
@ -50,7 +53,8 @@ namespace Forms
new Person("aboba3", "not aboba3", "20"), new Person("aboba3", "not aboba3", "20"),
}; };
tableComponent1.CreateTable("C:\\Ulstu\\COP\\Cop_25\\Controls\\docs\\table.pdf", "TABLE LUTI", mergeCells, columnInfos, people); tableComponent1.CreateTable("C:\\Ulstu\\COP\\Cop_25\\Controls\\docs\\table.pdf",
"TABLE LUTI", mergeCells, columnInfos, people);
} }
private void buttonDiagram_Click(object sender, EventArgs e) private void buttonDiagram_Click(object sender, EventArgs e)
@ -60,7 +64,8 @@ namespace Forms
data.Add("aboba2", new List<double> { 3, 2, 1, 3, 6 }); data.Add("aboba2", new List<double> { 3, 2, 1, 3, 6 });
data.Add("aboba3", new List<double> { 7, 3, 1, 2, 5 }); data.Add("aboba3", new List<double> { 7, 3, 1, 2, 5 });
diagramComponent1.CreateLineDiagram("C:\\Ulstu\\COP\\Cop_25\\Controls\\docs\\diagram.pdf", "Заголовок", "Линейная диаграмма", data, LegendAlign.bottom); diagramComponent1.CreateLineDiagram("C:\\Ulstu\\COP\\Cop_25\\Controls\\docs\\diagram.pdf",
"ZAGOLOVOK", "LINEYNAYA", data, LegendAlign.bottom);
} }
private void textBox1_TextChanged(object sender, EventArgs e) private void textBox1_TextChanged(object sender, EventArgs e)

View File

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework> <TargetFramework>net8.0-windows7.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>