简体   繁体   English

如何制作具有不同区域颜色的Excel图表?

[英]How do I make an Excel chart which has differing area colours?

Basically, I want to make something which looks like this: 基本上,我想做一个看起来像这样的东西:

例

I have no idea where to even start on this question. 我什至不知道从哪里开始这个问题。 I've checked the line graphs and the area graphs on my Excel 2015 for Mac, but I can't find anything which would be anything like this. 我已经在Mac上的Excel 2015中检查了折线图和面积图,但是找不到类似这样的东西。

My data is organised in three columns like so: 我的数据分为三列,如下所示:

Date | Debt | President
=======================
1987 | $$$  | Reagan
1988 | $$$  | Reagan
1989 | $$$  | Bush
1990 | $$$  | Bush
1991 | $$$  | Bush
1992 | $$$  | Bush
1993 | $$$  | Clinton
1994 | $$$  | Clinton

I've solved the problem. 我已经解决了问题。 And it only took five hours on and off of exasperated problem solving! 愤怒的问题解决只花了五个小时! I've always hated how people who solve their own problems never post the solution on the internet (like this ). 我一直讨厌谁解决自己问题的人怎么也不会发布在互联网(如在解决这个 )。 So, I posted the solution here. 所以,我在这里发布了解决方案。 Hope it isn't too far out of decorum. 希望它离礼节不会太远。

To accomplish this obnoxiously annoying feat, I created three new columns 为了完成这一令人讨厌的烦人壮举,我创建了三个新列

Date | Debt | Reagan | Bush | Clinton | President
=================================================
1987 | $$$  | $$$    | #N/A | #N/A    | Reagan
1988 | $$$  | $$$    | #N/A | #N/A    | Reagan
1989 | $$$  | #N/A   | $$$  | #N/A    | Bush
1990 | $$$  | #N/A   | $$$  | #N/A    | Bush
1991 | $$$  | #N/A   | $$$  | #N/A    | Bush
1992 | $$$  | #N/A   | $$$  | #N/A    | Bush
1993 | $$$  | #N/A   | #N/A | $$$     | Clinton
1994 | $$$  | #N/A   | #N/A | $$$     | Clinton

I was able to generate that pattern by using an if statement for the C , D , and E columns: IF(C2="Reagan",B2, NA()) , with changed C2 and "Reagan" values where relevant (that is, for the Bush column, D2 and "Bush" , and so on). 我能够通过对CDE列使用if语句来生成该模式: IF(C2="Reagan",B2, NA()) ,并在相关的地方更改C2"Reagan"值(即,对于"Bush"列,请输入D2"Bush" ,依此类推)。

This created a series of lines. 这创建了一系列线。 I plotted those lines using the Excel plot function. 我使用Excel绘图功能绘制了这些线。 Then, I right-clicked to have those lines and told them to plot as areas. 然后,我右键单击以显示这些线,并告诉他们将其绘制为区域。 Then, I had what I wanted. 然后,我有了想要的东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM