Tuesday, July 24, 2007

Adding lines on a stacked column chart

Today I had a need to do a graph in Excel where it need to display a stacked column chart and also a line in the same graph.

The data for this is as follows for three years

2008 2009 2010
12000 14000 16000
1000 1000 1000
170000 180000 200000

I wanted a stacked column with the first two rows and a line with the last row. But when I chose the normal 2d column chart, it was showing all three rows as one stacked column.

To get the desired results, I followed the following steps

First, include all three rows in the series part of the chart data and choose the 2d stacked column chart

Next, right-click on the colored part of the bar that corresponds to the year and choose "Chart Type". Then select the first Line graph. Click Ok

Finally, right click on the graph and choose chart options and tick the 'Value Y Axis' tick box under the secondary axis lable of the 'Axes' tab

You should now have the first two rows displayed as a stacked column chart and the third row displayed as a line graph above your columns.


Uzaimi Musa said...

Thank you for your tip. I ma able to construct the grap 2 stacked column and 1 line with two axis.

Anonymous said...

Thanks a lot....this is great and really helpful.

Databases and Data Visualisations Course for kids Week 1

As mentioned last week, I have started the Databases and Data Visualisations course for kids aged between 11 to 15 years yesterday. It was...