section |
# Dataset & Chart
Women and men’s earnings—Annual Salary in thousands—after college.
In this tutorial we create a dumbbell chart showing the big differences between women and men’s earnings after college.
|
|
section |
# Create a Legend using Column Names
|
|
timeBegin |
timeEnd |
text |
0.00 |
5.30 |
Create a legend using the `Men` and `Women` column names
|
|
timeBegin |
timeEnd |
text |
5.30 |
17.00 |
Choose the colors for the `Men` and `Women` categories
|
|
section |
# Create a Data-Driven Guide
|
|
timeBegin |
timeEnd |
text |
17.00 |
20.64 |
Change the sub-layout to vertical stacking
|
|
timeBegin |
timeEnd |
text |
20.64 |
32.13 |
After adding a data-driven guide to the glyph editor, add `Men`, and `Women` to the data-driven guide
|
|
section |
# Create a Dumbbell Glyph
|
|
timeBegin |
timeEnd |
text |
32.13 |
41.09 |
Add a line mark to the glyph
|
|
timeBegin |
timeEnd |
text |
41.09 |
48.50 |
Add a circle symbol for the `Women` category to the glyph and map the color legend scale to the fill for the circle
|
|
timeBegin |
timeEnd |
text |
48.50 |
55.80 |
Add a circle symbol for the `Men` category to the glyph and map the color legend scale to the fill for the circle
|
|
timeBegin |
timeEnd |
text |
55.80 |
60.04 |
Assign the color for the `Men` categorey
|
|
section |
# Add Labels to Show School Name
|
|
timeBegin |
timeEnd |
text |
60.04 |
70.07 |
Add a text mark for the label and move it to the desired position
|
|
timeBegin |
timeEnd |
text |
70.07 |
74.07 |
Map `School` to the label's `Text`
|
|
timeBegin |
timeEnd |
text |
74.07 |
78.13 |
Adjust the left margin of the chart
|
|
section |
# Finalize the Chart
|
|
timeBegin |
timeEnd |
text |
78.13 |
85.05 |
Adjust the tick position of the data axis
|
|
timeBegin |
timeEnd |
text |
85.05 |
93.20 |
Order the dumbbells by `Men`
|
|