如何使用 Microsoft Excel 对堆积条形图中的列进行分组?

如何使用 Microsoft Excel 对堆积条形图中的列进行分组?

我按照这里的教程进行操作:

http://ksrowell.com/blog-visualizing-data/2013/05/16/how-to-make-a-gantt-chart-for-repeated-tasks/

为过去几年我玩过的游戏创建一个条形图。以下是我的数据样本:

games,game_id,start_date,elapsed_time,end_date
APB Reloaded,1,2013-04-20,120:00,2014-06-24
APB Reloaded,1,2014-04-05,24:00,2014-04-05
ARK: Survival Evolved,2,2015-12-14,600:00,2016-01-08
ARK: Survival Evolved,2,2016-01-23,24:00,2016-01-23
ARK: Survival Evolved,2,2016-02-13,24:00,2016-02-13
ARK: Survival Evolved,2,2016-05-13,648:00,2016-09-09
ARK: Survival Evolved,2,2016-09-16,336:00,2016-09-30
ARK: Survival Evolved,2,2016-11-16,192:00,2016-11-24
ARK: Survival Evolved,2,2016-12-03,24:00,2016-12-03
Age of Empires II: HD Edition,3,2013-05-07,144:00,2013-05-13
Age of Empires II: HD Edition,3,2013-07-02,240:00,2013-07-11
Age of Empires II: HD Edition,3,2013-08-16,336:00,2013-08-30
Age of Empires II: HD Edition,3,2014-01-01,24:00,2014-01-01
Age of Empires II: HD Edition,3,2014-03-24,24:00,2014-03-24
Age of Empires II: HD Edition,3,2014-06-05,24:00,2014-06-05
Age of Empires II: HD Edition,3,2014-09-13,48:00,2014-09-14
Age of Empires II: HD Edition,3,2014-12-31,24:00,2014-12-31
Age of Empires II: HD Edition,3,2015-04-04,24:00,2015-04-04
Age of Empires II: HD Edition,3,2015-05-01,24:00,2015-05-01
Age of Empires II: HD Edition,3,2015-05-29,696:00,2015-05-01
Age of Empires II: HD Edition,3,2015-05-30,24:00,2015-05-30
Age of Empires II: HD Edition,3,2015-10-06,24:00,2015-10-07
Age of Empires II: HD Edition,3,2015-11-05,192:00,2015-11-13
Age of Empires II: HD Edition,3,2015-11-25,192:00,2015-12-03
Age of Empires II: HD Edition,3,2015-12-12,24:00,2015-12-12
Age of Empires II: HD Edition,3,2015-12-21,24:00,2015-12-21
Age of Empires II: HD Edition,3,2016-02-27,24:00,2016-02-27
Age of Empires II: HD Edition,3,2016-03-24,216:00,2016-04-02
Age of Empires II: HD Edition,3,2016-04-29,192:00,2016-05-07
Age of Empires II: HD Edition,3,2016-05-21,24:00,2016-05-21
Age of Empires II: HD Edition,3,2016-06-11,24:00,2016-06-11
Age of Empires II: HD Edition,3,2016-07-01,192:00,2016-07-09
Age of Empires II: HD Edition,3,2017-02-03,24:00,2017-02-03
Age of Empires Online,4,2014-04-26,24:00,2014-04-26
Age of Empires Online,4,2014-06-21,48:00,2014-06-22
Age of Empires Online,4,2014-06-29,24:00,2014-06-29

生成的堆积条形图如下所示:

Imgur 链接到堆积条形图

我已经尝试了教程页面上的所有方法。这是应该删除重复的部分:

步骤 3. 在同一栏中绘制所有具有相同 x 值的项目。右键单击垂直轴并选择“设置轴格式”。选择“轴选项”,单击“日期轴”。单击“日期倒序”。在“横轴交叉”下,选择“在最大日期”以在底部显示日期。

但当我这样做时,它根本没有改变图表。任何帮助都值得赞赏。这些只是到第 5 步的结果:

在此处输入图片描述

答案1

当您使用日期轴执行这些步骤时,垂直标签需要是 B 列中的数字。您将 A 列中的文本绘制为垂直标签。说明如下:

步骤 1. 创建堆积条形图。突出显示范围 b3:d51,单击“插入”选项卡。选择“条形图”,然后选择 2D“堆积条形图”。B 列是用于图表 X 值的数字。

不过,您的数据根本不适合该图表。制图技巧是将一天的值组合起来。X 轴仅显示一天,因此甘特图显示一天中使用设备的时间(或者在您的情况下,是进行比赛的时间)。由于每场比赛都有多天,因此这实际上并不明显。X 轴显示所有日期,但也许您希望以这种方式查看。 在此处输入图片描述

相关内容