回复 25楼Alice的帖子
额、、加上connectionstyle=findresource() as style 就不对了??
源码不知道对不对
ChartData ribbon = new ChartData();
chart.Data = ribbon;
chart.ChartType = ChartType.Ribbon;
Random rd = new Random();
for (int i = 0; i < 5; i++)
{
XYDataSeries ds1=new XYDataSeries();
ds1.XValues = new DoubleCollection { 1, 2,3,4,5,6,7,8,9 };
ds1.ConnectionStyle = FindResource("ribbon") as Style;
int[] p = new int[9];
for (int j = 0; j < p.Length; j++)
{
p[j] = rd.Next(1, 1000);
}
ds1.ValuesSource = p;
ribbon.Children.Add(ds1);
} |