dpdmembers
asked on
Bind Database to Silverlight 4 Chart
How do I Bind a Database to my Silverlight 4 Chart with VB
Silverlight doesn't support any database providers. You need to get the data using a web service or wcf service. This data willbe put in a data model and will be binded to silverlight chart control.
ASKER
I have created the service but I need help with the binding to the chart. I can bind it to a datagrid but not a chart.
can we your xaml code and binding code?
ASKER
XAML Code
<UserControl x:Class="SilverlightWithWC FService.M ainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="650" d:DesignWidth="525" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit">
<Grid x:Name="LayoutRoot" Background="White" Height="650" Width="847">
<toolkit:Chart HorizontalAlignment="Left" Margin="27,432,0,0" Name="Chart1" Title="LEI Index" VerticalAlignment="Top" Height="206" Width="452">
<toolkit:Chart.Series>
<toolkit:ColumnSeries x:Name="ColumnSeries1" Title="Index"
IndependentValueBinding="{ Binding Observation}"
DependentValueBinding="{Bi nding LEI_Index}"
ItemsSource="{Binding}" />
</toolkit:Chart.Series>
</toolkit:Chart>
</Grid>
</UserControl>
Behind Code
Private Sub client_LEIListCompleted(By Val sender As Object, ByVal e As LEIListCompletedEventArgs)
ColumnSeries1.ItemsSource = e.Result
End Sub
<UserControl x:Class="SilverlightWithWC
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="650" d:DesignWidth="525" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit">
<Grid x:Name="LayoutRoot" Background="White" Height="650" Width="847">
<toolkit:Chart HorizontalAlignment="Left"
<toolkit:Chart.Series>
<toolkit:ColumnSeries x:Name="ColumnSeries1" Title="Index"
IndependentValueBinding="{
DependentValueBinding="{Bi
ItemsSource="{Binding}" />
</toolkit:Chart.Series>
</toolkit:Chart>
</Grid>
</UserControl>
Behind Code
Private Sub client_LEIListCompleted(By
ColumnSeries1.ItemsSource = e.Result
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Examples would be nice