Grouped Data & Multi-axis chart (ASP.NET MVC)

7 posts, 1 answers
  1. Ronald
    Ronald avatar
    19 posts
    Member since:
    Jun 2012

    Posted 12 Aug 2013 Link to this post

    Hi,

    Is it possible to have a multi axis chart using grouped data?

    Country     Project     Product     Date
    Philippines Project1    Product A   1-May-13
    Philippines Project1    Product B   1-May-13
    Philippines Project1    Product C   1-May-13
    Japan       Project2    Product D   3-Jun-13
    Japan       Project2    Product E   3-Jun-13
    I have the above data and I need to show a line chart of the number of distinct Projects per country per month in the firs axes and on the 2nd I want to show the number of Products per country per month in a column chart.

    On the CategoryAxis is the date field and I've set the ChartAxisBaseUnit to Months.

    The line chart seem to be working fine but he column chart isn't displaying as expected.

    I could use some help.

    Thanks,
    Ronald
  2. Hristo Germanov
    Admin
    Hristo Germanov avatar
    703 posts

    Posted 12 Aug 2013 Link to this post

    Hi Roland,

    Could you give me a simple project or just a jsBin/jsFiddle that I can examine and advice you further?

    Regards,
    Hristo Germanov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Ronald
    Ronald avatar
    19 posts
    Member since:
    Jun 2012

    Posted 12 Aug 2013 Link to this post

    Hi Hristo,

    Attached is a sample project, also from your team but for another matter.  I just modified it and added my own chart.  Its calling the Action "GetProducts" in the Home controller.

    Currently, the line chart should show the number of products per region/month.  I would like to add another axes to display another chart (column or area) that will show the distinct number of Projects per month (if possible) or the number of projects per region/month.

    Thanks for looking into this for me.

    Ronald
  4. Hristo Germanov
    Admin
    Hristo Germanov avatar
    703 posts

    Posted 14 Aug 2013 Link to this post

    Hi Ronald,

    In this case you need to pass flat data to the chart. You need to have data for all series that you need and you need to map this series with the axis that you want.

    I hope this helps you.

    Regards,
    Hristo Germanov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  5. Ronald
    Ronald avatar
    19 posts
    Member since:
    Jun 2012

    Posted 14 Aug 2013 Link to this post

    Hi Hristo,

    So I shouldn't use grouped data?

    Should my view model look something like below:
    public class Products
    {
        public int EuropeProductCount { get; set; }
        public int AsiaProductCount { get; set; }
        public int AmericasProductCount { get; set; }
        public int EuropeProjectCount { get; set; }
        public int AsiaProjectCount { get; set; }
        public int AmericasProjectCount { get; set; }
        public string MonthYear { get; set; }
    }

    So the series of the line chart, which will show the number of products per month, will map to EuropeProductCount, AsiaProductCount, AmericasProductCount.
    The series for the column chart on the other axis, which will show the number of projects per month, would map to EuropeProjectCount, AsiaProjectCount, AmericasProjectCount.

    Is my understanding above accurate?

    Thanks,
    Ronald


  6. Answer
    Hristo Germanov
    Admin
    Hristo Germanov avatar
    703 posts

    Posted 14 Aug 2013 Link to this post

    Hello Ronald,

    This is the right way to bind complex group data. If you want to pass group data to the chart you will have one series configuration that will be copied for all groups that you have. And you can't specify the axis that will be responsible for all series that you will render.

    Regards,
    Hristo Germanov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  7. Ronald
    Ronald avatar
    19 posts
    Member since:
    Jun 2012

    Posted 14 Aug 2013 Link to this post

    Thanks, Hristo.  That's what I thought but I wasn't sure.  I didn't want to proceed with that if it was possible to do it using grouped data.
    At least now I can go ahead knowing I didn't miss anything.

    Thanks again for helping me out.
Back to Top