Bonjour,
Le plus simple est de montrer le code :
Voici l'exemple d'utilisation donné :
Code XAML : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 <Window x:Class="WpfTest.Window3" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:am="http://schemas.amcharts.com/charts/wpf/2009/xaml" Title="Window3" Height="500" Width="500"> <am:ColumnChart> <am:ColumnChart.Series> <am:SeriesItem ID="0" Text="legend0" /> <am:SeriesItem ID="1" Text="legend1" /> <am:SeriesItem ID="2" Text="legend2" /> </am:ColumnChart.Series> <am:ColumnChart.Graphs> <am:ColumnChartGraph> <am:ColumnChartGraph.DataItems> <am:ColumnDataPoint SeriesID="0" Value="0" /> <am:ColumnDataPoint SeriesID="1" Value="1" /> <am:ColumnDataPoint SeriesID="2" Value="2" /> </am:ColumnChartGraph.DataItems> </am:ColumnChartGraph> </am:ColumnChart.Graphs> </am:ColumnChart> </Window>
Je souhaiterais binder les sources des items comme ceci :
Code XAML : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 <am:ColumnChart SeriesSource="{Binding Datas}"> <am:ColumnChart.Graphs> <am:ColumnChartGraph DataItemsSource="{Binding Datas}"> </am:ColumnChartGraph> </am:ColumnChart.Graphs> </am:ColumnChart>
Data étant une ObservableCollection d'objet "DataChart", ma question est comment spécifier maintenant sur quelle propriété de DataChart ID, Text, SeriesID et Value doivent être bindés ?
Partager