Bar graph

5 posts, 0 answers
  1. Oliver
    Oliver avatar
    33 posts
    Member since:
    Jan 2011

    Posted 03 Sep 2012 Link to this post

    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
  2. Peshito
    Admin
    Peshito avatar
    497 posts

    Posted 05 Sep 2012 Link to this post

    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.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Oliver
    Oliver avatar
    33 posts
    Member since:
    Jan 2011

    Posted 05 Sep 2012 Link to this post

    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
  5. Peshito
    Admin
    Peshito avatar
    497 posts

    Posted 10 Sep 2012 Link to this post

    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.

  6. Oliver
    Oliver avatar
    33 posts
    Member since:
    Jan 2011

    Posted 10 Sep 2012 Link to this post

    Hi Peshito,

    All looking good.

    Thanks for your help. Much appreciated.
Back to Top
UI for WPF is Visual Studio 2017 Ready