回复 5楼menghuanyunxia的帖子
请参考我的设置代码:
- private void Form1_Load(object sender, EventArgs e)
- {
- FarPoint.Win.Spread.Chart.SpreadChart chart = new FarPoint.Win.Spread.Chart.SpreadChart();
- chart.Location = new Point(0,0);
- chart.Size = new System.Drawing.Size(400, 400);
- BarSeries bseries = new BarSeries();
- bseries.SeriesName = "Series 0";
- bseries.Values.Add(2.0);
- bseries.Values.Add(4.0);
- bseries.Values.Add(3.0);
- bseries.Values.Add(5.0);
- LineSeries lseries = new LineSeries();
- lseries.Values.Add(2.0);
- lseries.Values.Add(4.0);
- lseries.Values.Add(3.0);
- lseries.Values.Add(5.0);
- YPlotArea plotArea = new YPlotArea();
- plotArea.Location = new PointF(0.2f, 0.2f);
- plotArea.Size = new SizeF(0.6f, 0.6f);
- plotArea.Series.Add(bseries);
- plotArea.Series.Add(lseries);
- LabelArea label = new LabelArea();
- label.Text = "Bar Chart";
- label.Location = new PointF(0.5f, 0.02f);
- label.AlignmentX = 0.5f;
- label.AlignmentY = 0.0f;
- LegendArea legend = new LegendArea();
- legend.Location = new PointF(0.98f, 0.5f);
- legend.AlignmentX = 1.0f;
- legend.AlignmentY = 0.5f;
- ChartModel model = new ChartModel();
- model.LabelAreas.Add(label);
- model.LegendAreas.Add(legend);
- model.PlotAreas.Add(plotArea);
- chart.Model = model;
- fpSpread1.Sheets[0].Charts.Add(chart);
- }
复制代码 |