I trying to create line chart using
WinRT XAML Toolkit[
^] which is a port of SilverlightToolkit. The problem is values are displayed but I have no line(nothing is draw) in my LineChart. I followed the method used in this
site[
^]
The result I get is
http://i.imgur.com/IK3suOZ.jpg[
^]
Xaml I used for drawing chart is:
<Charting:Chart x:Name="lineChart" HorizontalAlignment="Left" Height="460" Margin="422,53,0,0" Grid.Row="1" VerticalAlignment="Top" Width="793" Loaded="Chart_Loaded">
<Charting:LineSeries Height="100" Width="100" IndependentValuePath="ValueCode" DependentValuePath="ExchangeRate" IsSelectionEnabled="True"/>
</Charting:Chart>
And C# code behind:
private void Chart_Loaded(object sender, RoutedEventArgs e)
{
List<testClass> test2 = new List<testClass>();
test2.Add(new testClass() { ValueCode = "USD", ExchangeRate =2});
test2.Add(new testClass() { ValueCode = "USD", ExchangeRate = 4 });
test2.Add(new testClass() { ValueCode = "USD", ExchangeRate = 6 });
(lineChart.Series[0] as LineSeries).ItemsSource = test2;
}
testClass code:
public class testClass
{
string value_code;
int exchange_rate;
public int ExchangeRate
{
get { return exchange_rate; }
set { exchange_rate = value; }
}
public string ValueCode
{
get { return value_code; }
set { value_code = value; }
}
}
I've tested LineChart, ColumnChart and PieChart - PieChart is the only one working as there are no lines,columns to draw.
(I am using latest version of WinRT XAML Toolkit)