private void Form1_Load(object sender, EventArgs e)
{
fpSpread1.ActiveSheet.SetArray(0, 0, new Object[,] { { null, "A", "B", "C", "D", "E" } });
fpSpread1.ActiveSheet.SetArray(1, 0, new Object[,] { { "S-1", 50, 25, 55, 30, 26 } });
// datasource
FarPoint.Win.Spread.Chart.SeriesDataField df1 = new FarPoint.Win.Spread.Chart.SeriesDataField(fpSpread1, "DataFieldSeriesName", "Sheet1!$A$2:$A$2", FarPoint.Win.Spread.Chart.SegmentDataType.Text);
FarPoint.Win.Spread.Chart.SeriesDataField df2 = new FarPoint.Win.Spread.Chart.SeriesDataField(fpSpread1, "DataFieldCategoryName", "Sheet1!$B$1:$F$1", FarPoint.Win.Spread.Chart.SegmentDataType.Text);
FarPoint.Win.Spread.Chart.SeriesDataField df3 = new FarPoint.Win.Spread.Chart.SeriesDataField(fpSpread1, "DataFieldValue", "Sheet1!$B$2:$F$2");
// LineSeries
FarPoint.Win.Chart.LineSeries series = new FarPoint.Win.Chart.LineSeries();
series.SeriesNameDataSource = df1;
series.CategoryNames.DataSource = df2;
series.Values.DataSource = df3;
// BarSeries
FarPoint.Win.Chart.BarSeries bseries = new FarPoint.Win.Chart.BarSeries();
// Set datasource again after resetting.
FarPoint.Win.Spread.Chart.SeriesDataField df1b = new FarPoint.Win.Spread.Chart.SeriesDataField(fpSpread1, "DataFieldSeriesName", "Sheet1!$A$2:$A$2", FarPoint.Win.Spread.Chart.SegmentDataType.Text);
FarPoint.Win.Spread.Chart.SeriesDataField df2b = new FarPoint.Win.Spread.Chart.SeriesDataField(fpSpread1, "DataFieldCategoryName", "Sheet1!$B$1:$F$1", FarPoint.Win.Spread.Chart.SegmentDataType.Text);
FarPoint.Win.Spread.Chart.SeriesDataField df3b = new FarPoint.Win.Spread.Chart.SeriesDataField(fpSpread1, "DataFieldValue", "Sheet1!$B$2:$F$2");
bseries.SeriesNameDataSource = df1b;
bseries.CategoryNames.DataSource = df2b;
bseries.Values.DataSource = df3b;
// PlotArea
FarPoint.Win.Chart.YPlotArea plotArea = new FarPoint.Win.Chart.YPlotArea();
plotArea.Location = new PointF(0.2f, 0.2f);
plotArea.Size = new SizeF(0.6f, 0.6f);
plotArea.Series.Add(series);
plotArea.Series.Add(bseries);
// ChartModel
FarPoint.Win.Chart.ChartModel model = new FarPoint.Win.Chart.ChartModel();
model.PlotAreas.Add(plotArea);
// SpreadChart
FarPoint.Win.Spread.Chart.SpreadChart chart1 = new FarPoint.Win.Spread.Chart.SpreadChart();
chart1.ChartName = "chart1";
chart1.Size = new Size(200, 180);
chart1.Location = new Point(0, 60);
chart1.Model = model;
fpSpread1.ActiveSheet.Charts.Clear();
fpSpread1.ActiveSheet.Charts.Add(chart1);
}