KOP/Components/Nonvisual/UserControlHist.cs

43 lines
1.3 KiB
C#
Raw Permalink Normal View History

2024-10-16 01:47:44 +04:00
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static System.Runtime.InteropServices.JavaScript.JSType;
namespace Components.Nonvisual
{
public partial class UserControlHist : Component
{
public UserControlHist()
{
InitializeComponent();
}
public UserControlHist(IContainer container)
{
container.Add(this);
InitializeComponent();
}
public void CreateHist(string filePath, string title, string histTitle,
LegendAlignment alignment, Dictionary<string, int[]> data)
{
if (string.IsNullOrEmpty(filePath))
throw new ArgumentException("Filename cannot be empty");
if (string.IsNullOrEmpty(title))
throw new ArgumentException("Title cannot be empty");
if (string.IsNullOrEmpty(histTitle))
throw new ArgumentException("Hist title cannot be empty");
if (data.Count == 0)
throw new ArgumentException("Data cannot be empty");
SaveToPdf saver = new SaveToPdf();
saver.CreateHist(filePath, title, histTitle, alignment, data);
}
}
}