【发布时间】:2011-12-05 13:03:37
【问题描述】:
我使用 devexpress 制作了一个动态 3D 饼图。控制功能的出色表现给我留下了深刻的印象。不过,我有点沮丧。 我希望我的饼图点具有我在代码中设置的不同颜色(稍后将由用户使用某种形式的托盘或组合框进行更改,尚不确定)。不幸的是,我似乎无法为我的数据系列的点找到颜色方法。
这里的代码不包括大量被注释掉的尝试:
Series series1 = new Series("Series1", ViewType.Pie3D);
chartControl2.Series.Add(series1);
series1.DataSource = chartTable;
series1.ArgumentScaleType = ScaleType.Qualitative;
series1.ArgumentDataMember = "names";
series1.ValueScaleType = ScaleType.Numerical;
series1.ValueDataMembers.AddRange(new string[] { "Value" });
//series1.Label.PointOptions.PointView = PointView.ArgumentAndValues;
series1.LegendPointOptions.PointView = PointView.ArgumentAndValues;
series1.LegendPointOptions.ValueNumericOptions.Format = NumericFormat.Percent;
series1.LegendPointOptions.ValueNumericOptions.Precision = 0;
// Adjust the value numeric options of the series.
series1.Label.PointOptions.ValueNumericOptions.Format = NumericFormat.Percent;
series1.Label.PointOptions.ValueNumericOptions.Precision = 0;
// Adjust the view-type-specific options of the series.
((Pie3DSeriesView)series1.View).Depth = 20;
((Pie3DSeriesView)series1.View).ExplodedPoints.Add(series1.Points[0]);
((Pie3DSeriesView)series1.View).ExplodedPoints.Add(series1.Points[1]);
((Pie3DSeriesView)series1.View).ExplodedPoints.Add(series1.Points[2]);
((Pie3DSeriesView)series1.View).ExplodedPoints.Add(series1.Points[3]);
((Pie3DSeriesView)series1.View).ExplodedDistancePercentage = 20;
chartControl2.Legend.Visible = true;
所以我需要类似 chartcontrol2.series1.point[0].color = color.blue;像这样的。
【问题讨论】:
-
你试过
Series1.point[0].ColorSeries1.point[1].Color..so on -
是的,series1.point[] 没有颜色方法
标签: c# colors devexpress pie-chart