Grouped series not generated - fix

Thread is closed for posting
5 posts, 0 answers
  1. Marbry
    Marbry avatar
    123 posts
    Member since:
    Aug 2012

    Posted 01 Aug 2011 Link to this post

    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.
  2. Nikolay
    Admin
    Nikolay avatar
    385 posts

    Posted 04 Aug 2011 Link to this post

    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.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Marbry
    Marbry avatar
    123 posts
    Member since:
    Aug 2012

    Posted 04 Aug 2011 Link to this post

    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.
  5. Nikolay
    Admin
    Nikolay avatar
    385 posts

    Posted 10 Aug 2011 Link to this post

    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.

  6. Russ
    Russ avatar
    2 posts
    Member since:
    Oct 2011

    Posted 22 Nov 2011 Link to this post

    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.

       
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017