Сданная лаба.
This commit is contained in:
parent
4b6d44e659
commit
85f3440431
@ -128,8 +128,8 @@ namespace VisualComponentsForm
|
||||
try
|
||||
{
|
||||
histogram = new(dialog.FileName, "Третье задание", "Гистограмма", EnumAreaLegend.Right, new List<DataHistogram> {
|
||||
new DataHistogram("Доход", "Январь", "300"), new DataHistogram("Доход", "Апрель", "600"),
|
||||
new DataHistogram("Доход", "Июль", "400"), new DataHistogram("Доход", "Октябрь", "200")
|
||||
new DataHistogram("Доход", "Январь", 300), new DataHistogram("Доход", "Апрель", 600),
|
||||
new DataHistogram("Доход", "Июль", 400), new DataHistogram("Доход", "Октябрь", 200)
|
||||
});
|
||||
|
||||
componentWordHistogram.AddHistogram(histogram);
|
||||
|
@ -87,7 +87,7 @@ namespace VisualComponentsLib.Components
|
||||
Val = "48"
|
||||
});
|
||||
|
||||
properties.AppendChild(new Bold());
|
||||
properties.Append(new Bold());
|
||||
|
||||
docRun.AppendChild(properties);
|
||||
|
||||
@ -166,7 +166,21 @@ namespace VisualComponentsLib.Components
|
||||
throw new Exception("Некорректное заполнение информации для шапки таблицы");
|
||||
}
|
||||
|
||||
tc.Append(new Paragraph(new Run(new Text(item.Value.NameColumn))));
|
||||
Paragraph tableHeader = new();
|
||||
|
||||
var Run = new Run();
|
||||
|
||||
var headerProperties = new RunProperties();
|
||||
|
||||
headerProperties.Append(new Bold());
|
||||
|
||||
Run.AppendChild(headerProperties);
|
||||
|
||||
Run.AppendChild(new Text(item.Value.NameColumn));
|
||||
|
||||
tableHeader.AppendChild(Run);
|
||||
|
||||
tc.Append(tableHeader);
|
||||
|
||||
_tr.Append(tc);
|
||||
|
||||
@ -207,7 +221,24 @@ namespace VisualComponentsLib.Components
|
||||
{
|
||||
if(val.Name == item.Value.NameField)
|
||||
{
|
||||
tc.Append(new Paragraph(new Run(new Text(val.GetValue(setDataTable.DataList[i]).ToString()))));
|
||||
var newParagraph = new Paragraph();
|
||||
|
||||
var newRun = new Run();
|
||||
|
||||
var runProperties = new RunProperties();
|
||||
|
||||
if(indexHeaderWidth == 0)
|
||||
{
|
||||
runProperties.Append(new Bold());
|
||||
}
|
||||
|
||||
newRun.AppendChild(runProperties);
|
||||
|
||||
newRun.AppendChild(new Text(val.GetValue(setDataTable.DataList[i]).ToString()));
|
||||
|
||||
newParagraph.AppendChild(newRun);
|
||||
|
||||
tc.Append(newParagraph);
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ namespace VisualComponentsLib.Components
|
||||
// Добавление новых серий. Обратите внимание, что массивы данных не должны быть пустыми, а массивы должны быть одного размера.
|
||||
foreach (var data in simpleHistogram.DataList)
|
||||
{
|
||||
seriesColl.Add(data.NameData, categories, new double[] { double.Parse(data.Data) });
|
||||
seriesColl.Add(data.NameData, categories, new double[] { data.Data });
|
||||
}
|
||||
|
||||
// Move the chart's legend to the top right corner.
|
||||
@ -92,7 +92,7 @@ namespace VisualComponentsLib.Components
|
||||
{
|
||||
foreach (var _data in data)
|
||||
{
|
||||
if(string.IsNullOrEmpty(_data.NameSeries) || string.IsNullOrEmpty(_data.Data))
|
||||
if(string.IsNullOrEmpty(_data.NameSeries) || string.IsNullOrEmpty(_data.Data.ToString()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -12,9 +12,9 @@ namespace VisualComponentsLib.Components.SupportClasses
|
||||
|
||||
public string NameData { get; set; } = string.Empty;
|
||||
|
||||
public string Data { get; set; } = string.Empty;
|
||||
public double Data { get; set; }
|
||||
|
||||
public DataHistogram(string nameSeries, string nameData, string data)
|
||||
public DataHistogram(string nameSeries, string nameData, double data)
|
||||
{
|
||||
NameSeries = nameSeries;
|
||||
NameData = nameData;
|
||||
|
Loading…
x
Reference in New Issue
Block a user