你好!
this.fpSpread1_Sheet1_SpreadChart2 = new FarPoint.Win.Spread.Chart.SpreadChart(pieSeries5, "SpreadChart2"); 这句没看明白,运行错误。
按钮调用代码:
private void button2_Click(object sender, EventArgs e)
{
CellRange cr1 = new CellRange(1, 1, 1, 2);
CellRange cr2 = new CellRange(2, 1, 1, 2);
CellRange cr3 = new CellRange(3, 1, 1, 2);
CellRange cr4 = new CellRange(4, 1, 1, 2);
//this.fpSpread1_Sheet1.AddChart(cr1, typeof(FarPoint.Win.Chart.PieSeries), 300, 300, 0, 100);
//this.fpSpread1_Sheet1.AddChart(cr, typeof(FarPoint.Win.Chart.PieSeries), 400, 300, 0, 300, FarPoint.Win.Chart.ChartViewType.View3D, true);
this.fpSpread1_Sheet1.AddChart(cr1, typeof(FarPoint.Win.Chart.PieSeries), 300, 300, 0, 100, FarPoint.Win.Chart.ChartViewType.View3D, true);
this.fpSpread1_Sheet1.AddChart(cr2, typeof(FarPoint.Win.Chart.PieSeries), 300, 300, 310, 100, FarPoint.Win.Chart.ChartViewType.View3D, true);
this.fpSpread1_Sheet1.AddChart(cr3, typeof(FarPoint.Win.Chart.PieSeries), 300, 300, 620, 100, FarPoint.Win.Chart.ChartViewType.View3D, true);
this.fpSpread1_Sheet1.AddChart(cr4, typeof(FarPoint.Win.Chart.PieSeries), 300, 300, 930, 100, FarPoint.Win.Chart.ChartViewType.View3D, true);
//FarPoint.Win.Chart.PieSeries pieSeries5 = new FarPoint.Win.Chart.PieSeries();
//pieSeries5.LabelVisible = true;
//pieSeries5.LabelContainsCategoryName = true;
//pieSeries5.CategoryNames.AddRange(new string[] {
//"未完成",
//"已完成",
//""});
//this.fpSpread1_Sheet1_SpreadChart = new FarPoint.Win.Spread.Chart.SpreadChart(pieSeries5, "SpreadChart2");
}
这样就生成了图1的效果。 |