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

  • SEARCH
  • Home
  • 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 7494315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T17:27:49+00:00 2026-05-29T17:27:49+00:00

Hi i’m plotting columnseries graph using chart controls by downloading Microsoft wpftoolkit. I can

  • 0

Hi i’m plotting columnseries graph using chart controls by downloading Microsoft wpftoolkit.
I can able to draw the graph using my data but the background color of the bar was not changing.How to change the bar color to red instead of default LightSteelBlue color.
Here is my code

<Window x:Class="net.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:DVC="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"
xmlns:DV="clr-namespace:System.Windows.Controls.DataVisualization;assembly=System.Windows.Controls.DataVisualization.Toolkit"
Title="Window1" Height="800" Width="800" xmlns:my="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit">
<Grid>
       <DVC:Chart Canvas.Top="80" Canvas.Left="10" Name="mcChart"
        Width="800" Height="450" FontSize="12"
        Background="DarkGray" Foreground="DarkRed">
        <DVC:Chart.Series>
            <DVC:ColumnSeries x:Name="Barchart" Title="Students"
               ItemsSource="{Binding list}" 
               IndependentValueBinding="{Binding Path=Name}"
               DependentValueBinding="{Binding Path=students}" >
            </DVC:ColumnSeries> 
        </DVC:Chart.Series>
     </DVC:Chart>
</Grid>

can any one tel me how to do this?.

Thanks in advance.
Please answer this.

  • 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-29T17:27:53+00:00Added an answer on May 29, 2026 at 5:27 pm

    In order to solve this problem, you can override the style.

    <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                        xmlns:chartingToolkit="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit">
    
      <!-- Resource dictionary entries should be defined here. -->
      <Style x:Key="MyColumnDataPointStyle"
             TargetType="{x:Type chartingToolkit:ColumnDataPoint}">
        <Setter Property="Background"
                Value="Red" />
        <Setter Property="BorderBrush"
                Value="Black" />
        <Setter Property="BorderThickness"
                Value="1" />
        <Setter Property="IsTabStop"
                Value="False" />
        <Setter Property="Template">
          <Setter.Value>
            <ControlTemplate TargetType="{x:Type chartingToolkit:ColumnDataPoint}">
    
              <Border x:Name="Root"
                      BorderBrush="{TemplateBinding BorderBrush}"
                      BorderThickness="{TemplateBinding BorderThickness}">
                <Border.ToolTip>
                  <ContentControl Content="{TemplateBinding FormattedDependentValue}" />
                </Border.ToolTip>
                <Grid Background="{TemplateBinding Background}">
                  <Rectangle>
                    <Rectangle.Fill>
                      <LinearGradientBrush>
                        <GradientStop Color="#77FFFFFF"
                                      Offset="0" />
                        <GradientStop Color="Transparent"
                                      Offset="1" />
                      </LinearGradientBrush>
                    </Rectangle.Fill>
                  </Rectangle>
                  <Border BorderBrush="#CCFFFFFF"
                          BorderThickness="1">
                    <Border BorderBrush="#77FFFFFF"
                            BorderThickness="1" />
                  </Border>
                  <Rectangle x:Name="SelectionHighlight"
                             Fill="Red"
                             Opacity="0" />
                  <Rectangle x:Name="MouseOverHighlight"
                             Fill="White"
                             Opacity="0" />
                </Grid>
              </Border>
            </ControlTemplate>
          </Setter.Value>
        </Setter>
      </Style>
    </ResourceDictionary>
    

    usage

    <Grid>
      <DVC:Chart Canvas.Top="80"
                 Canvas.Left="10"
                 Name="mcChart"
                 Width="800"
                 Height="450"
                 FontSize="12"
                 Background="DarkGray"
                 Foreground="DarkRed">
        <DVC:Chart.Series>
          <DVC:ColumnSeries x:Name="Barchart"
                            Style="{StaticResource MyColumnDataPointStyle}"
                            Title="Students"
                            ItemsSource="{Binding list}"
                            IndependentValueBinding="{Binding Path=Name}"
                            DependentValueBinding="{Binding Path=students}">
          </DVC:ColumnSeries>
        </DVC:Chart.Series>
      </DVC:Chart>
    </Grid>
    

    hope this helps you…

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

Sidebar

Related Questions

I want to construct a data frame in an Rcpp function, but when I
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I have a jquery bug and I've been looking for hours now, I can't
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

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.