Solved

Bind Database to Silverlight 4 Chart

Posted on 2011-02-21
6
1,206 Views
Last Modified: 2012-05-11
How do I Bind a Database to my Silverlight 4 Chart with VB
0
Comment
Question by:dpdmembers
  • 3
  • 3
6 Comments
 
LVL 25

Expert Comment

by:apeter
ID: 34957233
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.
0
 

Author Comment

by:dpdmembers
ID: 34963339
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.
0
 
LVL 25

Expert Comment

by:apeter
ID: 34972132
can we your xaml code and binding code?
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Author Comment

by:dpdmembers
ID: 34972356
XAML Code

<UserControl x:Class="SilverlightWithWCFService.MainPage"
    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="{Binding LEI_Index}"
                                   ItemsSource="{Binding}"   />
                         
            </toolkit:Chart.Series>
        </toolkit:Chart>
    </Grid>
</UserControl>

Behind Code

 Private Sub client_LEIListCompleted(ByVal sender As Object, ByVal e As LEIListCompletedEventArgs)
          ColumnSeries1.ItemsSource = e.Result
    End Sub

0
 
LVL 25

Accepted Solution

by:
apeter earned 500 total points
ID: 34985780
e.Result has a property Observation and LEI_Index? Try binding the itemsource or datacontext of toolkit:chart control.
0
 

Author Closing Comment

by:dpdmembers
ID: 35006553
Examples would be nice
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Javascript to set controls visibility 5 48
Reading the Web.Config using IIS 7.5? 4 47
Deploying to Azure 3 38
ASP.NET MVC -Add authentication 2 29
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question