This example demonstrates how to display several series of different view types within a single diagram.
Files to Review
- Form1.cs (VB: Form1.vb)
- Program.cs (VB: Program.vb)
Documentation
Does this example address your development requirements/objectives?
(you will be redirected to DevExpress.com to submit your response)
Example Code
C#using System;
using System.Windows.Forms;
using DevExpress.XtraCharts;
// ...
namespace CombineSeveralCharts3D {
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e) {
// Create an empty chart.
ChartControl combinedChart = new ChartControl();
// Create two series of different types.
Series series1 = new Series("Area Series", ViewType.Spline3D);
Series series2 = new Series("Line Series", ViewType.Bar3D);
// Add points to them.
series1.Points.Add(new SeriesPoint(1, new double[] { 10 }));
series1.Points.Add(new SeriesPoint(2, new double[] { 2 }));
series1.Points.Add(new SeriesPoint(3, new double[] { 14 }));
series1.Points.Add(new SeriesPoint(4, new double[] { 17 }));
series2.Points.Add(new SeriesPoint(1, new double[] { 5 }));
series2.Points.Add(new SeriesPoint(2, new double[] { 16 }));
series2.Points.Add(new SeriesPoint(3, new double[] { 4 }));
series2.Points.Add(new SeriesPoint(4, new double[] { 11 }));
// Add the series to the chart.
combinedChart.Series.Add(series2);
combinedChart.Series.Add(series1);
// Hide the legend (if necessary).
combinedChart.Legend.Visibility = DevExpress.Utils.DefaultBoolean.False;
// Add the chart to the form.
combinedChart.Dock = DockStyle.Fill;
this.Controls.Add(combinedChart);
}
}
}
C#using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace CombineSeveralCharts3D {
static class Program {
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main() {
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}