-
Notifications
You must be signed in to change notification settings - Fork 123
/
Copy pathChartAppearance.cs
55 lines (45 loc) · 1.88 KB
/
ChartAppearance.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#region Copyright Syncfusion Inc. 2001-2021
// Copyright Syncfusion Inc. 2001-2021. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using System;
using System.Text;
using Syncfusion.Windows.Forms.Chart;
using Syncfusion.Drawing;
using System.Drawing;
namespace Syncfusion.Windows.Forms.Chart.Samples
{
public static class ChartAppearance
{
public static void ApplyChartStyles(ChartControl chart)
{
#region ApplyCustomPalette
chart.Palette = ChartColorPalette.Custom;
chart.CustomPalette = new System.Drawing.Color[]
{
Color.FromArgb(12,189,244),
Color.FromArgb(162,206,54),
Color.FromArgb(249,65,104),
Color.FromArgb(119,119,247),
Color.FromArgb(239,187,20),
Color.FromArgb(244,127,49),
Color.FromArgb(217,0,115)
};
#endregion
#region Chart Appearance Customization
chart.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
chart.ElementsSpacing = 0;
chart.Series[0].Style.TextColor = Color.Gray;
chart.Series[0].Style.Font.Facename = "Sego UI";
chart.Series[0].Style.Font.Size = 10f;
chart.Series[0].Style.Border.Color = Color.Empty;
chart.Series[0].ConfigItems.PieItem.FillMode = ChartPieFillMode.AllPie;
chart.Series[0].ConfigItems.PieItem.HeightByAreaDepth = false;
chart.Series[0].ConfigItems.PieItem.HeightCoeficient = 0.1f;
#endregion
}
}
}