A graph for displaying numerical data like age
I want to show a variety of datapoints in a graph. For example I have several datapoints, each one representing the age of a user. What would be a good graph representing "10 users are 18 years old, 2 are 19 years, 1 is 20 years, 8 are 22 years...etc."?
The problem is, that the set of datapoints I want to represent may vary widely. For example I could need to represent just 5 datapoints with hugely varying numbers (= ages) or several hundred data points all between 20 and 30. So the intervall and the design of the graph needs to adapt to the datapoints I have.
I would love to hear some suggestions of people who ran into the same issue.
I would like to use a graph that shows the absolute number of responses for each numerical value ("8 are 22 years old") instead of the percentage ("24 % are 22 years old"). I think this might make the graph harder to understand, but shows significant more information, because the number of responses may vary widely and is a huge part of the information I like to deliver.
if possible, have the age ranges definable and dynamically represent the graph as and when age ranges are changed
What will this be used for? If you're trying to present a report with a breakdown of your users' ages, then having a normally-scaled graphic with a hundred 20-year olds and one 50-year-old will give an accurate representation, but if you plan to present the graph to the users such a representation would make the 50-year-old feel insignificant, and it could be better to adjust the relative representations of parts of the graph. Please provide more context about how the graph will be used.
@3nafish My company offers a mobile survey solution. So our customers create surveys on our webapp and can see the results on our webapp. So were thinking about supporting a new type of survey question "numerical data" for things like age, distance, time, etc. The results of a survey may vary widely. But I still want to create a reusable graph that all our customers can use to analyze their survey results.
There are so many good examples:
Age diagram might help. Please also see:
Example with absolute values (source)
The first thing I can think of would be a bar chart, so I'm going to look at your options there.
You don't need either axis to start at 0, but you do need steps along either axis to be the same:
- In your example you can't omit the 21y data point even though there are 0 cases.
- But you could have the axis range from 20 to 30.
If there are many points between 20 and 30 (say for each month) you can scale the width of each bar to make it fit. Or you can combine bars if that makes sense for your data (eg. four bars for months 1-3, 4-6, 7-9, 10-12)
If you have large gaps on your axis you can skip a section:
I like the your idea of using gaps and your intution that you don't necessarily have to start at 0. But I am still not sure, if this would be the right solution. My upvote anyhow.
Do you know any chart library that lets you add this gaps? I am using Higcharts to create graphs and apparently they do not have such a feature.