This repository has been archived by the owner on Oct 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Form1.cs
54 lines (43 loc) · 2.13 KB
/
Form1.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
using System;
using System.Windows.Forms;
using DevExpress.XtraCharts;
// ...
namespace Series_StackedSplineAreaChart {
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e) {
// Create a new chart.
ChartControl stackedSplineAreaChart = new ChartControl();
// Create two stacked spline area series.
Series series1 = new Series("Series 1", ViewType.StackedSplineArea);
Series series2 = new Series("Series 2", ViewType.StackedSplineArea);
// Add points to them.
series1.Points.Add(new SeriesPoint("A", 80));
series1.Points.Add(new SeriesPoint("B", 20));
series1.Points.Add(new SeriesPoint("C", 50));
series1.Points.Add(new SeriesPoint("D", 30));
series2.Points.Add(new SeriesPoint("A", 40));
series2.Points.Add(new SeriesPoint("B", 60));
series2.Points.Add(new SeriesPoint("C", 20));
series2.Points.Add(new SeriesPoint("D", 80));
// Add both series to the chart.
stackedSplineAreaChart.Series.AddRange(new Series[] { series1, series2 });
// Adjust the view-type-specific options of the series.
((StackedSplineAreaSeriesView)series1.View).LineTensionPercent = 10;
((StackedSplineAreaSeriesView)series2.View).LineTensionPercent = 70;
// Access the diagram's options.
((XYDiagram)stackedSplineAreaChart.Diagram).Rotated = true;
// Hide the legend (if necessary).
stackedSplineAreaChart.Legend.Visibility = DevExpress.Utils.DefaultBoolean.False;
// Add a title to the chart (if necessary).
stackedSplineAreaChart.Titles.Add(new ChartTitle());
stackedSplineAreaChart.Titles[0].Text = "A Stacked Spline Area Chart";
stackedSplineAreaChart.Titles[0].WordWrap = true;
// Add the chart to the form.
stackedSplineAreaChart.Dock = DockStyle.Fill;
this.Controls.Add(stackedSplineAreaChart);
}
}
}