Multiple BarSeries in Stack mode on 1 Y-axis

4 posts, 1 answers
  1. Vinc3nt
    Vinc3nt avatar
    10 posts
    Member since:
    Jun 2013

    Posted 03 Jul 2013 Link to this post

    Hi,

    I need to plot more than one BarSeries in Stack combine mode.

    Example :
    - One vertical Y-Axis and one horizontal X-Axis,
    - Two BarSeries in stack mode
    - Two other BarSeries in stack mode.

    When I implement this, the result is 1 Bar divided in 4, not 1 Bar divided in 2 and another one Bar divided in 2.

    I know the way to identify the Bar in stack mode is the vertical axis but Is there an other way ?

    Thank you,
    Vincent.
  2. Peshito
    Admin
    Peshito avatar
    496 posts

    Posted 05 Jul 2013 Link to this post

    Hello,

    This can be achieved by using the StackGroupKey property of the series and adding it to the series you want to group like this:
    <telerik:RadCartesianChart.Series>
        <telerik:BarSeries CombineMode="Stack" StackGroupKey="g1">
            <telerik:BarSeries.DataPoints>
                <telerik:CategoricalDataPoint Category="x1" Value="1" />
            </telerik:BarSeries.DataPoints>
        </telerik:BarSeries>
        <telerik:BarSeries CombineMode="Stack" StackGroupKey="g1">
            <telerik:BarSeries.DataPoints>
                <telerik:CategoricalDataPoint Category="x1" Value="1" />
            </telerik:BarSeries.DataPoints>
        </telerik:BarSeries>
        <telerik:BarSeries CombineMode="Stack" StackGroupKey="g2">
            <telerik:BarSeries.DataPoints>
                <telerik:CategoricalDataPoint Category="x2" Value="3" />
            </telerik:BarSeries.DataPoints>
        </telerik:BarSeries>
        <telerik:BarSeries CombineMode="Stack" StackGroupKey="g2">
            <telerik:BarSeries.DataPoints>
                <telerik:CategoricalDataPoint Category="x2" Value="3" />
            </telerik:BarSeries.DataPoints>
        </telerik:BarSeries>
    </telerik:RadCartesianChart.Series>

    Hope this helps.

    Regards,
    Peshito
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. DevCraft banner
  4. Vinc3nt
    Vinc3nt avatar
    10 posts
    Member since:
    Jun 2013

    Posted 05 Jul 2013 Link to this post

    Thank you for your answer.

    I tried your solution but I have an ArgumentException : La valeur n'est pas comprise dans la plage attendue (Value does not fall within expected range).

    Is there a problem adding multiple bar series in code behind ?


  5. Answer
    Peshito
    Admin
    Peshito avatar
    496 posts

    Posted 09 Jul 2013 Link to this post

    Hello Lamarque,

    I was not able to reproduce the error you have described. Please, find attached a sample project demonstrating the earlier approach described in my previous reply but this time in code behind.

    Hope this helps.

    Regards,
    Peshito
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top