CesChart - CesSolutions/Ces.WinForm.UI GitHub Wiki
Chart control to visualize data in "Area" and "Column" mode.
کنترل چارت امکان نمایش نمودا در دو حالت Area و Column را امکانپذیر می کند.

- CesChartTitle : Define title for chart.
- CesChartTitleVisible : Show/Hide chart title.
- CesLegend : List of legend title.
- CesLegendVisible : Show/Hide chart legend.
- CesCategoryVisible : Show/Hide char category as the bottom of chart area.
- CesCategoryGridLineVisible : Show/Hide grid line in chart area.
- CesScaleTitle : Define title for chart scale like: Time, %,...
- CesScaleVisible : Show/Hide chart scale.
- CesScale : Define scale step.
- CesTitleHeight : Set chart title height.
- CesCategoryHeight : Set chart category height.
- CesScaleWidth : Set width for chart scale.
- CesLegendWidth : Set width for chart legend.
- CesScaleIndicatorWidth : Set width for chart indicator next to scale area.
- CesColumnWidth : Set column width for "ColumnType" chart mode.
- CesTitleFont : Set font for chart title.
- CesScaleFont : Set font for chart scale.
- CesCategoryFont : Set font for chart category.
- CesLegendFont : Set font for legend.
- CesErrorFont : Set font for error message on chart.
- CesChartTitle : متن عنوان چارت.
- CesChartTitleVisible : نمایش / عدم نمایش عنوان چارت.
- CesLegend : فهرست راهنمای چارت.
- CesLegendVisible : نمایش / عدم نمایش فهرست راهنمای چارت.
- CesCategoryVisible : نمایش / عدم نمایش گروه بندی در چارت.
- CesCategoryGridLineVisible : نمایش / عدم نمایش خطوط گروه بندی چارت.
- CesScaleTitle : تعیین عنوان برای بخش درجه بندی چارت.
- CesScaleVisible : نمایش / عدم نمایش درجه بندی چارت.
- CesScale : درجه بندی چارت. این مقدار بصورت پیشفرض بصورت 10تایی افزایش می یابد.
- CesTitleHeight : تعیین ارتفاع عنوان چارت.
- CesCategoryHeight : تعیین ارتفاع گروه بندی چارت.
- CesScaleWidth : تعیین پهنای بخش درجه بندی چارت.
- CesLegendWidth : تعیین پهنای بخش فهرست راهنمای چارت.
- CesScaleIndicatorWidth : تعیین پهنای نشانگر بخش درجه بندی چارت.
- CesColumnWidth : پهنای نمودارهای ستونی
- CesTitleFont : تعیین فونت عنوان چارت.
- CesScaleFont : تعیین فونت بخش درجه بندی چارت.
- CesCategoryFont : تعیین فونت بخش گروه بندی چارت.
- CesLegendFont : تعیی فونت بخش فهرست راهنمای چارت.
- CesErrorFont : تعیین فونت جهت نمایش خطا در چارت. این خطا زمانی که در نمایش اطلاعات روی چارت با مشکل موجه شود نمایان میشود.
public enum CesChartTypeEnum
{
Column,
Area,
}
To send data via "CesChartData" class you must define a "Serie". Then after define a "Serie" you can assign that to any "CesChartData".
جهت ارسال اطلاعات از طریق کلاس CesChartData باید یک Serie برای آن تعیین کرد. لذا پس از تعیین یک Serie می توان آن را به تمامی CesChartData های مورد نظر تخصیص داده.
public class CesChartSerie
{
public string? Name { get; set; }
public Color SeriColor { get; set; }
public Color AreaColor { get; set; }
public CesChartTypeEnum Type { get; set; } = CesChartTypeEnum.Column;
}
CesChart has a property named CesData that accept array of CesChartData.
کنترل CesChart یک ویژگی با نام CesData دارد که آرایه ای از CesChartData می باشد.
public class CesChartData
{
public CesChartSerie? Serie { get; set; }
public string? Category { get; set; }
public decimal Value { get; set; }
}
After setting all properties of control, to refresh all features you must call this method.
پس از تعیین پارامترهای چارت باید متد GenerateChart را به منظور بروزرسانی کنترل چارت صدا بزنیم.
First of all we must define all series. In following example we defined one "ColumType" and two "AreaType" series.
ابتدا "Serie" های مورد نظر را تعریف میکنیم. در مثال زیر یک "Serie" از نوع "Column" و دو تا از نوع "Area" تعریف کردیه ایم:
// Chart Series
var serieA = new Ces.WinForm.UI.CesChart.CesChartSerie
{
Type = Ces.WinForm.UI.CesChart.CesChartTypeEnum.Column,
Name = "Serie A",
SeriColor = Color.Red
};
var serieB = new Ces.WinForm.UI.CesChart.CesChartSerie
{
Type = Ces.WinForm.UI.CesChart.CesChartTypeEnum.Area,
Name = "Serie B",
SeriColor = Color.Orange,
AreaColor = Color.FromArgb(50, Color.Orange)
};
var serieC = new Ces.WinForm.UI.CesChart.CesChartSerie
{
Type = Ces.WinForm.UI.CesChart.CesChartTypeEnum.Area,
Name = "Serie C",
SeriColor = Color.Blue,
AreaColor = Color.FromArgb(50, Color.Blue)
};
After defining series, "CesChartData" must be defined.
پس از آنکه Serie ها مشخص شدند باید "CesChartData" را تعریف کنیم.
//Chart Data
var chartDataB1 = new Ces.WinForm.UI.CesChart.CesChartData
{
Serie = serieB,
Category = "Category 3",
Value = 10
};
var chartDataB2 = new Ces.WinForm.UI.CesChart.CesChartData
{
Serie = serieB,
Category = "Category 1",
Value = 25
};
var chartDataB3 = new Ces.WinForm.UI.CesChart.CesChartData
{
Serie = serieB,
Category = "Category 5",
Value = 60
};
var chartDataC1 = new Ces.WinForm.UI.CesChart.CesChartData
{
Serie = serieC,
Category = "Category 1",
Value = 75
};
var chartDataC2 = new Ces.WinForm.UI.CesChart.CesChartData
{
Serie = serieC,
Category = "Category 2",
Value = 20
};
var chartDataC3 = new Ces.WinForm.UI.CesChart.CesChartData
{
Serie = serieC,
Category = "Category 4",
Value = 80
};
var chartDataC4 = new Ces.WinForm.UI.CesChart.CesChartData
{
Serie = serieC,
Category = "Category 5",
Value = 35
};
At the end we define a list of "CesChartData" and assign all declared variables in previous step to it. After pass data to "CesData" we call "CenerateChart" method.
در انتها یک لیست از نوع CesChartData تعریف میکنیم و متغیرهای تعریف شده در مرحله قبلی را به آن اضافه میکنیم و پس از آن لیست نهایی را به پارامتر CesData از کنترل چارت تخصیص می دهیم و جهت بروزرسانی چارت متد GenerateChart را صدا می زنیم.
var listOfData = new List<Ces.WinForm.UI.CesChart.CesChartData>();
listOfData.Add(chartDataA1);
listOfData.Add(chartDataA2);
listOfData.Add(chartDataA3);
listOfData.Add(chartDataA4);
listOfData.Add(chartDataA5);
listOfData.Add(chartDataB1);
listOfData.Add(chartDataB2);
listOfData.Add(chartDataB3);
listOfData.Add(chartDataC1);
listOfData.Add(chartDataC2);
listOfData.Add(chartDataC3);
listOfData.Add(chartDataC4);
cesChart1.CesData = listOfData;
cesChart1.GenerateChart();