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

Bar graph

4 Answers 61 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Oliver
Top achievements
Rank 1
Oliver asked on 03 Sep 2012, 06:34 AM
Product     |  Qty  |  Sales
Product A     50      500
Product B     60      600
Product C     55      550
Product D     65      650
Product A     40      400
Product B     45      450
Product C     35      350
Product D     25      250

I have the above data table. I would like to group by the Product and have the different Product description on the X-Axis. I would like to plot the sum of Qty and average of Sales on the same bar graph. So the legend would display Sum of Qty and Average of Sales.
I would like to achieve something like the following:



Any code samples would be great

4 Answers, 1 is accepted

Sort by
0
Peshito
Telerik team
answered on 05 Sep 2012, 08:37 AM
Hi Oliver,

Please, take a look and our online help topic demonstrating how to achieve similar scenario:
http://www.telerik.com/help/wpf/radchart-features-grouping-and-aggregation.html

Hope this helps.

Regards,
Peshito
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Oliver
Top achievements
Rank 1
answered on 06 Sep 2012, 03:02 AM
Hi Peshito,

I did have a look. But I can't seem to configure the graph to how I wanted it. What my problem is I have a different color for each grouping, which is the Product, instead of one color for Sales and another for Qty. Is there any way to do it?

thanks
0
Peshito
Telerik team
answered on 10 Sep 2012, 01:03 PM
Hi Oliver,

Please find attached sample project demonstrating how to group your data by Product.

Note that I have used GroupingSettings.ShouldFlattenSeries to true property which groups all 4 series of each seriesmapping I have as one. Following this approach leads to your expected result.

Regarding the legend items, you can create custom legend and add your custom logic on what the legend items to display. More about legends can be found here:
http://www.telerik.com/help/wpf/radchart-features-chart-legend.html

Hope this helps.

Greetings,
Peshito
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Oliver
Top achievements
Rank 1
answered on 11 Sep 2012, 02:01 AM
Hi Peshito,

All looking good.

Thanks for your help. Much appreciated.
Tags
Chart
Asked by
Oliver
Top achievements
Rank 1
Answers by
Peshito
Telerik team
Oliver
Top achievements
Rank 1
Share this question
or