This is a migrated thread and some comments may be shown as answers.

Multiple BarSeries in Stack mode on 1 Y-axis

7 Answers 132 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Vinc3nt
Top achievements
Rank 1
Vinc3nt asked on 03 Jul 2013, 07:49 AM
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.

7 Answers, 1 is accepted

Sort by
0
Peshito
Telerik team
answered on 05 Jul 2013, 07:13 AM
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 >>
0
Vinc3nt
Top achievements
Rank 1
answered on 05 Jul 2013, 07:20 AM
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 ?


0
Accepted
Peshito
Telerik team
answered on 09 Jul 2013, 07:53 AM
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 >>
0
William
Top achievements
Rank 1
answered on 12 Jun 2017, 08:03 PM
I cannot get a stacked bar to show, no matter what I do. I have verified the data is correct, I have set CombineMode to "None" or "Stack", added StackGroupKey values, and reset the ItemsSource. The .zip file you included doesn't load in VisualStudio.
0
Dinko
Telerik team
answered on 13 Jun 2017, 01:15 PM
Hello William,

We are reattaching the sample from the Petar Horozov reply. Can you give this project a try and let us know if it works for you. If not, you can elaborate more on your approach - what do you mean by the stacked bar is not showing. It will be great if you can send us isolated project from your application reproducing this behavior so we can directly investigate it.

Regards,
Dinko
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
William
Top achievements
Rank 1
answered on 13 Jun 2017, 02:32 PM
Sorry - it does not load into Visual studio.
0
Dinko
Telerik team
answered on 14 Jun 2017, 03:16 PM
Hello William,

We have tested the project and we successfully run the project using Visual Studio. Can you tell us which Visual Studio version are you using? Also, are you getting errors when you try to open it?

Regards,
Dinko
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
ChartView
Asked by
Vinc3nt
Top achievements
Rank 1
Answers by
Peshito
Telerik team
Vinc3nt
Top achievements
Rank 1
William
Top achievements
Rank 1
Dinko
Telerik team
Share this question
or