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 8480593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:20:15+00:00 2026-06-10T19:20:15+00:00

I want to display 3 series on my Silverlight toolkit horizontal bar chart…2 normal

  • 0

I want to display 3 series on my Silverlight toolkit horizontal bar chart…2 normal bar series and 1 stacked bar series (consisting of 2 SeriesDefinition). When I add the first 2 normal bar series, they show up next to each other as expected. But when I add the stacked series, it takes up the height of the whole row. Is there any way to combine the 2 types of series so that it displays as, from top to bottom – stacked, bar, bar?

Here is how I’m setting it up currently:

<charts:Chart Title="Manufacturer Overview" LegendTitle="Legend" Style="{StaticResource ZChartNoBackground}">
<charts:Chart.Series>
    <charts:StackedBarSeries>
        <charts:SeriesDefinition Title="Oppotunities" 
              ItemsSource="{Binding Path=TotalValueInFunnelByVendor}" 
              IndependentValueBinding="{Binding IndependentValue}" 
              DependentValueBinding="{Binding DependentValue}">
        </charts:SeriesDefinition>
        <!--SAMPLE DATA UNTIL REAL DATA IS IN-->
        <charts:SeriesDefinition Title="Flow Business" 
              ItemsSource="{Binding Path=TotalValueInFunnelByVendor}" 
              IndependentValueBinding="{Binding IndependentValue}" 
              DependentValueBinding="{Binding DependentValue}">
        </charts:SeriesDefinition>
    </charts:StackedBarSeries>
    <charts:BarSeries Title="Sales to date" 
              ItemsSource="{Binding Path=SalesToDateByVendor}" 
              IndependentValueBinding="{Binding IndependentValue}" 
              DependentValueBinding="{Binding DependentValue}">
    </charts:BarSeries>
    <charts:BarSeries Title="Forecasted" 
              ItemsSource="{Binding Path=ForecastedSalesByVendor}" 
              IndependentValueBinding="{Binding IndependentValue}" 
              DependentValueBinding="{Binding DependentValue}">
    </charts:BarSeries>
</charts:Chart.Series>
</charts:Chart>

Here is an image of the chart. Notice the GREEN and RED bars are correctly placed but the stacked bar is the height of the row and in the “back” of the other 2 series:

Chart snapshot

  • 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-06-10T19:20:16+00:00Added an answer on June 10, 2026 at 7:20 pm

    So after a whole bunch of looking around, I’ve come to the conclusion that this behavior is “by design” or a bug. I looked at the source code for the StackedBarSeries. I created a new class that inherited from StackedBarSeries and added code to the “UpdateDataItemPlacement” method that divides the height of the bar by the number of series in the SeriesHost:

    protected override void UpdateDataItemPlacement(IEnumerable<DefinitionSeries.DataItem> dataItems)
    {
        /* A BUNCH OF CODE FROM TOOLKIT */
    
        double sum = IsStacked100 ?
           group.DataItems.Sum(di =>Math.Abs(ValueHelper.ToDouble(di.DataPoint.ActualDependentValue))) : 
           1;
        if (0 == sum)
        {
            sum = 1;
        }
    
        // MY ADDITION        
        var numSeries = this.SeriesHost.Series.Count;
        int index = this.SeriesHost.Series.IndexOf(this);
        // END ADDITION
    
        double ceiling = 0;
        double floor = 0;
        foreach (DataItem dataItem in group.DataItems)
        {
            DataPoint dataPoint = dataItem.DataPoint;
            double value = IsStacked100 ? (ValueHelper.ToDouble(dataPoint.ActualDependentValue) * (100 / sum)) : ValueHelper.ToDouble(dataPoint.ActualDependentValue);
            if (ValueHelper.CanGraph(value))
            {
                double valueCoordinate = ActualDependentAxis.GetPlotAreaCoordinate(value).Value;
                double fillerCoordinate = (0 <= value) ? ceiling : floor;
    
                double topCoordinate = 0, leftCoordinate = 0, height = 0, width = 0, deltaCoordinate = 0;
                if (AxisOrientation.Y == ActualDependentAxis.Orientation)
                {
                    topCoordinate = plotAreaMaximumDependentCoordinate - Math.Max(valueCoordinate + fillerCoordinate, zeroCoordinate + fillerCoordinate);
                    double bottomCoordinate = plotAreaMaximumDependentCoordinate - Math.Min(valueCoordinate + fillerCoordinate, zeroCoordinate + fillerCoordinate);
                    deltaCoordinate = bottomCoordinate - topCoordinate;
                    height = (0 < deltaCoordinate) ? deltaCoordinate + 1 : 0;
                    leftCoordinate = categoryMinimumCoordinate;
                    width = categoryMaximumCoordinate - categoryMinimumCoordinate + 1;
    
                    // MY MODIFICATION
                    //adjusting the width and offset to allow multiple columns to render beside each other instead of overtop
                    width = width / numSeries;
                    leftCoordinate = leftCoordinate + (width * index);
                    //
                }
                else
                {
                    leftCoordinate = Math.Min(valueCoordinate + fillerCoordinate, zeroCoordinate + fillerCoordinate);
                    double rightCoordinate = Math.Max(valueCoordinate + fillerCoordinate, zeroCoordinate + fillerCoordinate);
                    deltaCoordinate = rightCoordinate - leftCoordinate;
                    width = (0 < deltaCoordinate) ? deltaCoordinate + 1 : 0;
                    topCoordinate = categoryMinimumCoordinate;
                    height = categoryMaximumCoordinate - categoryMinimumCoordinate + 1;
    
                    //MY MODIFICATION
                    //adjusting the height and offset to allow multiple columns to render beside each other instead of overtop
                    height = height / numSeries;
                    topCoordinate = topCoordinate + (height * index);
                    //
                }
    
                // THE REST OF THE CODE FROM THE TOOLKIT
           }  
           else
           {
               dataPoint.Visibility = Visibility.Collapsed;
           }
       }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to display a series of text in an animated way one after
I have a series of svg rectangles (using D3.js) and I want to display
I want to display series of images one by one when the app loads.
I want a similar behavior Chart as Google Annotated Time Line Chart to display
I want to display a series of my own descendent class of View in
I want to display a series of textboxes for additional input depending on the
I have a series of imageviews that I want to display, but on a
I am DataTemplating a listbox's ItemSource to display a series of comboboxes. I want
I want to display the X values on to the XY line chart As
I want display data from database in Listbox...Here is my code, It is not

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.