- Multi-Series Stacked

Multi-series / Stacked Example

Multi-series and stacked charts are similar to single series charts, but there can be multiple subcategories within each category. Let's say we want to find out the average amount of vacation hours that each type of job has spent. Furthermore, we wish to separate married employees from single employees. The SQL operation would be as the following:

SELECT title, martialstatus, AVG(vacationhours) FROM dillsample.employee GROUP BY title, martialstatus

The first item in the SELECT statement, title, is what will be plotted against the x-axis and the third item, which must return a numeric value, will be plotted against the y-axis. The second column contains the data that is categorized within each title category. Since there are two unique martial statuses, (m)arried and (s)ingle, there will be two bars per titlegroup.

If there were three unique values for martial statuses, then there would be a third bar per group.

A multi-series stacked chart is nearly identical to a multi-series chart, except that subcategory bars are stacked on each other.