Search code examples
vb.netvisual-studio-2010graphcrystal-reportscrystal-reports-2010

Crystal Reports Population Pyramid


I am trying to create a population pyramid almost exactly like the one in this question on the SAP forums but I am completely stumped as to how that's done. I'm working in an MVC4 environment and all my data is in a flat model. I've managed to pull the data in as .NET objects no problem, it's just formatting the chart that I am having trouble with. I am using Crystal Reports for Visual Studio 2010 and so far I have managed to create a pyramid that looks like this

Current population pyramid (with just 2 ages) (This currently has only two ages)

All I need is for the negative and positive sides to line up for each age, like the picture I linked to at the start of the post, but I can't work out how. I assume it displays like this because each age/gender combination is its own .NET object e.g. 'age_0_to_5_male_percent' and 'age_0_to_5_female_percent' so it treats each as its own row. Does anyone know how to do this? If you need more info please let me know.


Solution

  • Ok, so I ended up doing this with two bar charts and two datasets, one using the standard values and the other using calculated negative values (therefore forcing the chart to draw right to left). I then manually labelled and aligned everything and put the two bar charts 'back to back' to give it the effect of a population pyramid.

    It was a lot of work but it was the only way I could work out how to do it.

    The only problem that remained was that the labels on the left hand side displayed the negative values.