Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 565203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:50:50+00:00 2026-05-13T12:50:50+00:00

I’m trying to build a chart using the ColumnSeries from the wpf toolkit and

  • 0

I’m trying to build a chart using the ColumnSeries from the wpf toolkit and I appear to be having trouble with the data binding. Here is the xaml:

<Grid>
    <chartingToolkit:ColumnSeries Height="18" HorizontalAlignment="Left" Margin="188,169,0,0" Name="columnSeries1" VerticalAlignment="Top" Width="18" IndependentValueBinding="{Binding Path=Date}" DependentValueBinding="{Binding Path=Value}" />
</Grid>

In the code behind, I’m calling a stored procedure and putting the result in a DataTable like this:

string connString = ConfigurationManager.ConnectionStrings["string"].ConnectionString;
            using (SqlConnection cn = new SqlConnection(connString))
            {
                DataTable dt = new DataTable("T1");
                cn.Open();
                SqlCommand cmd = new SqlCommand("T1_sp", cn);
                cmd.CommandType = CommandType.StoredProcedure;  
                SqlDataAdapter da = new SqlDataAdapter(cmd);
                da.Fill(dt);
                columnSeries1.ItemsSource = dt.DefaultView;
                cn.Close();
            }

No error is being generated but I’m not getting a column chart either. If I take the same command and put it into a DataGrid, it works fine. What do I need to do to get this into my column chart?

If it helps, the data comming back in the data tables looks like this:

Date, type, Value  
2009-10-09, abc, 12.23  
2009-10-10, def, 13.35  

The date should be the independent value binding and the value should be the dependent value binding.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T12:50:51+00:00Added an answer on May 13, 2026 at 12:50 pm

    Here is my working code, cleaned up a little for clarity. Maybe this will help.

    xaml

    <charting:Chart Grid.Column="1" Grid.Row="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"  Background="Transparent" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
            <charting:Chart.Series>
                <charting:ColumnSeries x:Name="TrendChart" ItemsSource="{Binding Trend1}" IndependentValueBinding="{Binding Date}" DependentValueBinding="{Binding Spread}">
                </charting:ColumnSeries>
            </charting:Chart.Series>            
        </charting:Chart>
    

    code behind

    string connString = ConfigurationManager.ConnectionStrings["string"].ConnectionString;
                    using (SqlConnection cn = new SqlConnection(connString))
                    {
                        DataTable dt = new DataTable("Trend1");
                        cn.Open();
                        SqlCommand cmd = new SqlCommand("Trend1_sp", cn);                        cmd.CommandType = CommandType.StoredProcedure;
                        SqlDataAdapter da = new SqlDataAdapter(cmd);
                        da.Fill(dt);
                        TrendChart.ItemsSource = dt.DefaultView;
                    }
    

    Hope that helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.