Age pyramid

3 posts, 1 answers
  1. Sodi We
    Sodi We avatar
    160 posts
    Member since:
    Apr 2010

    Posted 10 Apr 2013 Link to this post

    Hey,

    We are looking for a special chart type or a way to make an age pyramid.

    The following link shows an example of the chart we are looking for.

    http://www.infovis.net/imagenes/T1_N158_A841_AgePyramid.gif

    Is there any way to create a chart like this ? 

    Thanks
    Sodi We
  2. Answer
    Peter
    Admin
    Peter avatar
    1611 posts

    Posted 12 Apr 2013 Link to this post

    Hi Sodi,

    Check out the attached sample report definition I have used the AdventureWorks database, thus you may have to modify the connection string. Here are the required steps to setup age pyramid chart type:

    1. From the Insert tab start the Stacked Bar Chart wizard;
    2. Set up the datasource;
    3. Set Gender field for Series;
    4. Set Years field for Categories;
    5. Set Count(Fields.Years) expression for Value;
    6. Click Finish;
    7. Now you have to make some changes with the Property Window;
    8. Select the Graph Series and change the Series X value expression =Count(Fields.Years) to =IIF(Fields.Gender = "M", -Count(Fields.Years), Count(Fields.Years))  ;
    9. Select the Graph X Axis and set the LabelFormat to {0:##;##}  . This will remove the minus sign from the axis labels;
    10. Optionally if you want the Y axis to show age ranges, you can change the CategoriesGroups (yearGroup1) Grouping expression as we have done.

    All the best,
    Peter
    the Telerik team

    Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

  3. DevCraft banner
  4. Jack
    Jack avatar
    4 posts
    Member since:
    Feb 2015

    Posted 20 Apr in reply to Peter Link to this post

    Thanks, this helped me get a working example going fairly easily.  I ended up using {0:#,#;#,#} for the LabelFormat option.  This adds commas to the axis value labels.
Back to Top