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

Grouped series not generated - fix

4 Answers 43 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Marbry
Top achievements
Rank 1
Marbry asked on 01 Aug 2011, 10:46 PM
At least for me it was.  I have a generic list of data i'm binding to the RadChart, where each item contains:
  Name, Quarter, Value

I'd like to display a bar for each quarter, grouped on the Name's.  I can get it to display either by just name, or just Quarter, but not both.  There are variable numbers of items per name, if there is not data present for a quarter there is no item in the list.

I assume from the examples and documentation that I would set,
    series[0].DataYColumn to Value
    DataGroupColumn to Quarter
    PlotArea.XAxis.DataLabelsColumn to Name

But that only yields one bar per Name.  I also tried setting the DataManager.ValuesXColumn, but achieve only the same results.

For some reason though, not explicitly setting series[0].DataYColumn to anything gave me the output that I wanted.  Rather counterinuitive, but it seems to have worked.

4 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 04 Aug 2011, 08:10 AM
Hello Marbry,

This is indeed the correct way to create such a scenario. Please, have a look at this example as a reference, it seems quite similar to yours, only there is Year, instead of Name and the grouping is by Year, thus having 2 series only.

All the best,
Nikolay
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Marbry
Top achievements
Rank 1
answered on 04 Aug 2011, 02:20 PM
I saw that.  How would you arrange it to get one column for each quarter rather than year, and grouped by year?

So you'd have year labled on the X axis, with 4 bars above each year representing the quarters for that particular year.
0
Nikolay
Telerik team
answered on 10 Aug 2011, 07:30 AM
Hello Marbry,

You can achieve the desired behavior by setting the DataGroupColumn to "Quarter" and the DataLabelsColumn to "Year" :
RadChart1.DataGroupColumn = "Quarter";
RadChart1.PlotArea.XAxis.DataLabelsColumn = "Year";
RadChart1.Legend.Appearance.GroupNameFormat = "#NAME:
#VALUE";

Hope this helps.

Best wishes,
Nikolay
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Russ
Top achievements
Rank 1
answered on 22 Nov 2011, 08:33 AM
I was having a similar problem as the OP in that, going with Nikolay's example, the value of the chart's bars would map to the Year's value (being the titles 2007, 2008 from the database), instead of the Value column from the data source.  Even though I had mapped the same as:

RadChart1.DataGroupColumn = "Quarter";
RadChart1.PlotArea.XAxis.DataLabelsColumn = "Year";
RadChart1.Legend.Appearance.GroupNameFormat = "#NAME:
#VALUE"

I finally got it to map correctly by changing the order of how I was pulling the columns in from the data source (sql query).  I had the data columns pulling Value, Quarter, then Year.  Once I rearranged the order (sql query) to Year, Quarter, Value (as seen in the example) the numbers magically mapped correctly.

   
Tags
Chart (Obsolete)
Asked by
Marbry
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Marbry
Top achievements
Rank 1
Russ
Top achievements
Rank 1
Share this question
or