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

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

6 Answers 124 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Ronald
Top achievements
Rank 1
Ronald asked on 12 Aug 2013, 06:57 AM
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

6 Answers, 1 is accepted

Sort by
0
Hristo Germanov
Telerik team
answered on 12 Aug 2013, 08:41 AM
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!
0
Ronald
Top achievements
Rank 1
answered on 12 Aug 2013, 09:41 AM
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
0
Hristo Germanov
Telerik team
answered on 14 Aug 2013, 08:34 AM
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!
0
Ronald
Top achievements
Rank 1
answered on 14 Aug 2013, 08:54 AM
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


0
Accepted
Hristo Germanov
Telerik team
answered on 14 Aug 2013, 09:03 AM
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!
0
Ronald
Top achievements
Rank 1
answered on 14 Aug 2013, 10:20 AM
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.
Tags
Charts
Asked by
Ronald
Top achievements
Rank 1
Answers by
Hristo Germanov
Telerik team
Ronald
Top achievements
Rank 1
Share this question
or