Skip to content

Commit 97b474e

Browse files
Added sample
1 parent 7817b13 commit 97b474e

File tree

16 files changed

+538
-2
lines changed

16 files changed

+538
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
# How-to-customize-series-border-in-Chart
2-
This example demonstrates how to customize series border for chart in Windows Forms.
1+
# How to customize series border in Chart
2+
This example demonstrates how to customize series border for chart in Windows Forms.

WindowsFormsApplication1/.vs/WindowsFormsApplication1/v15/Server/sqlite3/db.lock

Whitespace-only changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
5+
</startup>
6+
</configuration>

WindowsFormsApplication1/Form1.Designer.cs

Lines changed: 39 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

WindowsFormsApplication1/Form1.cs

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.ComponentModel;
4+
using System.Data;
5+
using System.Web;
6+
using System.Drawing;
7+
using System.Drawing.Drawing2D;
8+
using System.Linq;
9+
using System.Text;
10+
using System.Threading.Tasks;
11+
using System.Windows.Forms;
12+
using Syncfusion.Windows.Forms.Chart;
13+
using Syncfusion.Drawing;
14+
15+
namespace WindowsFormsApplication1
16+
{
17+
public partial class Form1 : Form
18+
{
19+
ChartControl PieChart1 = new Syncfusion.Windows.Forms.Chart.ChartControl();
20+
public Form1()
21+
{
22+
BindingList<PortfolioShareList> portfolioShareList = new BindingList<PortfolioShareList>();
23+
24+
portfolioShareList.Add(new PortfolioShareList("1999", 3));
25+
26+
portfolioShareList.Add(new PortfolioShareList("2000", 7));
27+
28+
portfolioShareList.Add(new PortfolioShareList("2001", 12));
29+
30+
portfolioShareList.Add(new PortfolioShareList("2002", 18));
31+
32+
portfolioShareList.Add(new PortfolioShareList("2003", 22));
33+
34+
PieChart1.Width = 800;
35+
PieChart1.Height = 400;
36+
37+
this.PieChart1.PrimaryXAxis.ValueType = ChartValueType.Category;
38+
39+
this.Controls.Add(PieChart1);
40+
41+
CategoryAxisDataBindModel dataSeriesModelSharesChart = new CategoryAxisDataBindModel(portfolioShareList);
42+
dataSeriesModelSharesChart.CategoryName = "SymbolEn";
43+
dataSeriesModelSharesChart.YNames = new string[] { "AvailableShareCount" };
44+
ChartSeries chartSeries = new ChartSeries("AvailableShareCount", ChartSeriesType.Column);
45+
chartSeries.CategoryModel = dataSeriesModelSharesChart;
46+
chartSeries.Style.Interior = new BrushInfo(Color.Green);
47+
chartSeries.Style.Border.Width = 1;
48+
chartSeries.Style.Border.Color = Color.Transparent;
49+
this.PieChart1.Series.Clear();
50+
this.PieChart1.Series.Add(chartSeries);
51+
this.PieChart1.PrimaryXAxis.ValueType = ChartValueType.Category;
52+
53+
}
54+
public class PortfolioShareList
55+
{
56+
private string symbolEn;
57+
58+
private double availableShareCount;
59+
60+
public string SymbolEn
61+
{
62+
get { return symbolEn; }
63+
64+
set { symbolEn = value; }
65+
}
66+
public double AvailableShareCount
67+
{
68+
get { return availableShareCount; }
69+
70+
set { availableShareCount = value; }
71+
}
72+
73+
public PortfolioShareList(string symbolEn, double availableShareCount)
74+
{
75+
this.SymbolEn = symbolEn;
76+
77+
this.AvailableShareCount = availableShareCount;
78+
}
79+
}
80+
}
81+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using System.Windows.Forms;
6+
7+
namespace WindowsFormsApplication1
8+
{
9+
static class Program
10+
{
11+
/// <summary>
12+
/// The main entry point for the application.
13+
/// </summary>
14+
[STAThread]
15+
static void Main()
16+
{
17+
Application.EnableVisualStyles();
18+
Application.SetCompatibleTextRenderingDefault(false);
19+
Application.Run(new Form1());
20+
}
21+
}
22+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("WindowsFormsApplication1")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("WindowsFormsApplication1")]
13+
[assembly: AssemblyCopyright("Copyright © 2018")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("e29a3c28-6b4f-4c5b-ae74-92c5b83bea80")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

0 commit comments

Comments
 (0)