Does anyone have an example of codebehind data binding for the 2D bar chart.
I am trying to figure out what the datamapping statement should look like.
One simple approach can be:
<igCA:XamChart x:Name="xamChart" Loaded="xamChart_Loaded"> <igCA:XamChart.Series> <igCA:Series x:Name="BarSeries" ChartType="Bar" DataMapping="Label=Label;Value=Value;ToolTip=Value"> </igCA:Series> </igCA:XamChart.Series> </igCA:XamChart>
<igCA:XamChart x:Name="xamChart" Loaded="xamChart_Loaded">
<igCA:XamChart.Series>
<igCA:Series x:Name="BarSeries" ChartType="Bar" DataMapping="Label=Label;Value=Value;ToolTip=Value">
</igCA:Series>
</igCA:XamChart.Series>
</igCA:XamChart>
...
public partial class Window1 : Window
{
public Window1()
InitializeComponent();
}
private void xamChart_Loaded(object sender, RoutedEventArgs e)
ObservableCollection<Data> collection = new ObservableCollection<Data>();
collection.Add(new Data("a", 5));
collection.Add(new Data("b", 15));
collection.Add(new Data("c", 10));
collection.Add(new Data("d", 20));
this.BarSeries.DataSource = collection;
public class Data
public Data(string label, double value)
this.Label = label;
this.Value = value;
public string Label { get; set; }
public double Value { get; set; }