Vizzlo's bar chart makes it easy for you to create a graphic to show a categorical variable along with a continuous one.
What is a bar chart?
A bar chart is a common graphical display when you want to show quantitative values for a set of categories. The bars present the categorical data by rectangular bars. The length of the bars is proportional to the numerical values associated with each category.
Every chart comes with default data. Vizzlo allows you to insert two columns of data which must be arranged as follows:
To enter your data, click on `Spreadsheet` in the menu bar. You can copy&paste your data, or upload a XLSX or CSV file. The chart is fully interactive, so a third option is to click on a bar and simply adjust the values of each bar directly in the sidebar. The data we used for the life expectancy example can be downloaded here.
Customize your chart
When you open a new bar chart you will see a chart similar to this one:
In the sidebar under Layout Settings you have several options to change the chart's appearance:
— Horizontal chart means you can swap x and y-axis
— Custom bar width means you can change the width for all bars
— Same color for all bars is true by default, if you click the checkbox the colors will be taken from your theme; click on the color input below to change the color for all bars when Same color for all bars is true
— Sort by value either ascending or descending
Using the data on life expectancy from the initial example, your chart will look like this:
There is way too much going on in this chart. The value label overlap, bars are too wide for the given 4:3 layout, the axis labels look off. We need to clean this up a bit.
The data covers the time from 1960 to 2018 so the bars will follow a natural order. Hence, we don't need to show that information on the horizontal axis. To remove the x-axis first click on the dropdown `Axes` in the sidebar, under `X-axis` you will see a checkbox Axis.
Remove values and show y-axis
In the sidebar under `Axes` there is a second tab called `Y-axis`. There you find the options to
— change the axis title
— change the number format of the axis tick labels and the values shown in the graph
— show/hide the y-axis
— show/hide the grid lines
— show/hide values above the bars
— set a minimum and maximum to the axis range
— set a scale interval
Adjust the document layout
The chart shows 60 data points in total and looks a bit cluttered with the 4:3 layout. We can adjust the bar width or change the layout. Let's do the latter.
In the sidebar under `Document` you find the option `Document layout`. Click on the dropdown menu and choose any of the default layout or create your own. We go with 16:9.
Adjust color for individual bars
The chart is interactive. Just click on any bar to adjust its properties. In the sidebar a card will open with all possible customization options. Our goal is to color positive values (life expectancy in the USA > OECD average) differently from negative values (life expectancy in the USA < OECD average). Unfortunately there is no automated way to do that yet so this means hand work. 🙁
Change the title of the chart
Click on the title of the chart and change it. You will notice that there is the option to add a subtitle too. In the footer we will credit the data source as it is common.
Remove y-axis line
The default settings for axis and grid lines are part of your theme. To change that, click on `Customize theme` in the sidebar. In the theme editor you can
— change the color palette
— change fonts
— change axis and grid lines
— add an overlay image (like the Vizzlo logo in this example)
Add reference lines
You might have noticed there is a fourth dropdown menu called `Analysis`. Click on the `+` icon and you see the option to add
— Benchmark a line
— Growth rate
— Reference line
Let's add a moving average with a window size of 5 years. Choose the option Trendline --> Sliding average. Adjust the window size, line width and color as you like.
Add a text annotation
As the first reader of your chart you might ask yourself in which year the figures turned negative? We can add a text and line annotation. Click on `Annotation` in the menu bar to add them.