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

Combine stack and cluster bars

2 Answers 47 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Alberto
Top achievements
Rank 1
Alberto asked on 28 Oct 2013, 10:11 PM
Hello,

I wonder if it is possible to combine stack and cluster bars to have something like the image that I am attaching.

So far I can create Bar series with combine mode stack or cluster but not both.

I am creating the series in the code behind like this:

BarSeries barSer = new BarSeries();
barSer.ShowLabels = true;
barSer.CombineMode = ChartSeriesCombineMode.Stack;
 
// or
 
BarSeries barSer = new BarSeries();
barSer.ShowLabels = true;
barSer.CombineMode = ChartSeriesCombineMode.Cluster;
 
foreach (DataRow dr in dtData.Rows)
            {
                barSer.DataPoints.Add(new CategoricalDataPoint() { Category = dr["Name"], Label = string.Format("{0:N}", dr["Value"]), Value = double.Parse(dr["Value"].ToString()) });
                 
            }

Thanks in advance.

Alberto

2 Answers, 1 is accepted

Sort by
0
Accepted
Pavel R. Pavlov
Telerik team
answered on 31 Oct 2013, 04:01 PM
Hello,

We managed to achieve your requirements in the attached project. Please take a look at it and let us know if you need any further assistance.

Basically, you can use the CombineMode and the StackGroupKey properties of the BarSeries. The first property defines that the bars should be stacked one next to another and the second one groups the different stacks.

I hope this project will be helpful.

Regards,
Pavel R. Pavlov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
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
Alberto
Top achievements
Rank 1
answered on 31 Oct 2013, 07:10 PM
Hi Pavel,

That's exactly what I needed.

Thanks a lot.

Alberto
Tags
Chart
Asked by
Alberto
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Alberto
Top achievements
Rank 1
Share this question
or