我用了,中文教程上的代码来写了下,代码如下:- FarPoint.Win.Spread.NamedStyle styleCold = new FarPoint.Win.Spread.NamedStyle();
- FarPoint.Win.Spread.NamedStyle styleCool = new FarPoint.Win.Spread.NamedStyle();
- FarPoint.Win.Spread.NamedStyle styleMild = new FarPoint.Win.Spread.NamedStyle();
- FarPoint.Win.Spread.NamedStyle styleWarm = new FarPoint.Win.Spread.NamedStyle();
- FarPoint.Win.Spread.NamedStyle styleHot = new FarPoint.Win.Spread.NamedStyle();
- styleCold.BackColor = Color.Blue;
- styleCold.ForeColor = Color.White;
- styleCool.BackColor = Color.Cyan;
- styleMild.BackColor = Color.Lime;
- styleWarm.BackColor = Color.Yellow;
- styleHot.BackColor = Color.Red;
- for (int col = 0; col < 6; col++)
- {
- fpSpread1.ActiveSheet.SetConditionalFormat(0, col, styleCold, FarPoint.Win.Spread.ComparisonOperator.LessThanOrEqualTo, "32");
- fpSpread1.ActiveSheet.SetConditionalFormat(0, col, styleCool, FarPoint.Win.Spread.ComparisonOperator.Between, "32", "55");
- fpSpread1.ActiveSheet.SetConditionalFormat(0, col, styleMild, FarPoint.Win.Spread.ComparisonOperator.Between, "55", "75");
- fpSpread1.ActiveSheet.SetConditionalFormat(0, col, styleWarm, FarPoint.Win.Spread.ComparisonOperator.Between, "75", "85");
- fpSpread1.ActiveSheet.SetConditionalFormat(0, col, styleHot, FarPoint.Win.Spread.ComparisonOperator.GreaterThan, "85");
- }
复制代码 效果如图所示:
jpg
跟我选中chart的select data后出现的那个虚线框有很大的区别,
jpg
怎么才能让图1出现图2的效果呢?
谢谢!!! |