A bar graph is a chart with rectangular bars of length that are usually proportional to the magnitudes or frequencies of what they represent. Bar/column charts are used for comparing two or more values. Furthermore, a multi-series chart compares both the sub-values of a data group and data groups against one another.
Assuming we want to create a column chart based off of dillsample.employee that reflects the number of vacation hours each employee has taken, we will want to extract data from the VacationHours column. We will use the following SQL statement to accomplish this:
SELECT employeeid, vacationhours FROM dillsample.employee
Given this, EmployeeID will be plotted along the x-axis and VacationHours will be along the y-axis. The value plotted along the y-axis must be a numeric value.
Note that the chart will only return a maximum of 50 items along the x-axis entirely for aesthetic purposes. If we wished to have the chart only display the vacation hours of employees with an employee ID between 100 and 150, we would change the SQL statement to include a WHERE clause:
SELECT employeeid, vacationhours FROM dillsample.employee WHERE employeeid > 100 AND employeeid < 150
A bar chart is nearly identical to a column chart with its data being presented horizontally instead of vertically.