回复 6楼Alice的帖子
Hi Alice
可能我说的不明白,我的意思是DataSeries的个数不确定,我想把DataSeries的集合都写成绑定的形式
<c1Chart:C1Chart Name="C1Chart2D">
<c1Chart:C1Chart.Data>
<c1Chart:ChartData ItemNames="{TemplateBinding XAxisLables}" SeriesItemsSource="{TemplateBinding DataSeriesCollection}">
</c1Chart:ChartData>
</c1Chart:C1Chart.Data>
<c1Chart:C1ChartLegend DockPanel.Dock="Right" />
</c1Chart:C1Chart>
DataSeries series1 = new DataSeries()
{
Label = "label1",
Values = new DoubleCollection() { 12, 23, 32, 12, 4 },
RenderMode = RenderMode.Default
};
DataSeries series2 = new DataSeries()
{
Label = "label2",
Values = new DoubleCollection() { 18, 29, 37, 20, 10 },
RenderMode = RenderMode.Default
};
ObservableCollection<DataSeries> collection = new ObservableCollection<DataSeries>();
collection.Add(series1);
collection.Add(series2);
item.DataSeriesCollection = collection;
我Binding 这个SeriesItemsSource也没看到图型,不知道怎么回事,由于我这个是在Xamarin的项目,所以只提供了这一点,我用时是把这个放在ListView 里充当ListViewItem 用的
|