Best practice of data visualization within Data Analysis in different fields and industries is combining multiple series in one chart to examine and get richer insight about collected data. Moreover, it allows researchers to make conclusions about the researching phenomena out of each data set, to search patterns and relationships both within a collection and across collections. Modify the code from the previous tutorial Simple 2D Chart and create one additional line.
// Generate new data for second series.
data = new SeriesPoint[pointCounter];
for (int i = 0; i < pointCounter; i++)
{
data[i].X = (double)i;
data[i].Y = Math.Sin(i * 0.2) * 50 + 50;
}
// Create another PointLineSeries and set new color and line-pattern for it.
var series2 = new PointLineSeries (chart.ViewXY, chart.ViewXY.XAxes[0], chart.ViewXY.YAxes[0]);
series2.LineStyle.Color = Color.FromArgb(255, 255, 67, 0);
series2.LineStyle.Pattern = LinePattern.DashDot;
series2.Title.Text = "Sinus data";
// 3. Set data-points into series.
series2.Points = data;
// Add series to chart.
chart.ViewXY.PointLineSeries.Add(series2);
Any series can be reassigned to any created X- and Y-axis by configuring properties AssignXAxisIndex for X-axis index assignment and AssignYAxisIndex for Y-axis index assignment. See Multiple Axes.