跳到主要内容

如何在Excel中的图表中对(两级)轴标签进行分组?

例如,您有一个购买表,如下图所示,您需要创建一个带有两个杠杆的日期标签和水果标签的X轴标签的柱形图,同时将日期标签按水果分组,如何解决它? 本文提供了几种方法来帮助您在Excel图表中对(两级)轴标签进行分组。


通过调整Excel中源数据的布局来分组(两级)轴标签

第一种方法将指导您在Excel中创建柱形图之前更改源数据的布局。 您可以执行以下操作:

1。 将水果列移到“日期”列之前,先切割水果列,然后在“日期”列之前粘贴。

2。 选择水果列,但列标题除外。 在我们的情况下,请选择范围A2:A17,然后单击 将A到Z排序 上的按钮 时间 标签。
doc组轴标签2

3。 在抛出“排序警告”对话框中,保留 扩大选择 选项已选中,然后单击 排序 按钮。

4。 在“水果”列中,选择第一个相同的单元格序列,表示A2:A6,然后单击 主页 > 合并与中心。 然后在弹出的Microsoft Excel对话框中单击“确定”按钮。 请参阅以下屏幕截图:
doc组轴标签01doc组轴标签02
然后合并由Apple填充的第一系列相邻单元格。 见下面的截图:
doc组轴标签03

5。 重复步骤4,并合并其他填充相同值的单元格。

提示:一键合并Excel中所有用相同值填充的相邻单元格
如果您安装了 Kutools for Excel,您可以应用它 合并相同的单元格 实用程序,只需单击一下即可合并所有包含相同值的相邻单元格。


广告合并相同的单元格2

6。 选择源数据,然后单击 插入柱形图 (或 )> 插页 标签。

现在,新创建的柱形图具有两级X轴,并且在X轴中,日期标签按水果分组。 请参见下面的屏幕截图:


在Excel中使用数据透视图对(两级)轴标签进行分组

数据透视图工具功能如此强大,它可以帮助您在Excel中轻松地创建一种图表,该图表的一种标签由另一种标签在两个杠杆轴中分组。 您可以执行以下操作:

1。 通过选择源数据创建数据透视图,并:
(1)在Excel 2007和2010中,单击 数据透视表 > 数据透视图 ,在 组上 插页 标签;
(2)在Excel 2013中,单击 枢轴图 > 枢轴图 ,在 图表 组上 插页 标签。

2。 在打开的对话框中,选中 现有工作表 选项,然后在当前工作表中选择一个单元格,然后单击 OK 按钮。

3。 现在,在打开的“数据透视表字段”窗格中,将“日期”字段和“水果”字段拖到 部分,然后将金额拖到 价值观 部分。

笔记:
(1)提交的水果必须高于提交的日期 部分。
(2)除了拖动外,还可以右键单击一个文件,然后选择 添加到行标签 or 增值 在右键菜单中。

然后,日期标签在新创建的数据透视图中按水果自动分组,如下图所示:


演示:法线图表或数据透视图中的组(两级)轴标签


Kutools for Excel:超过 300 个方便的工具触手可及! 立即开始 30 天免费试用,没有任何功能限制。 立即下载!

最佳办公生产力工具

🤖 Kutools 人工智能助手:基于以下内容彻底改变数据分析: 智能执行   |  生成代码  |  创建自定义公式  |  分析数据并生成图表  |  调用 Kutools 函数...
热门特色: 查找、突出显示或识别重复项   |  删除空白行   |  合并列或单元格而不丢失数据   |   不使用公式进行四舍五入 ...
超级查询: 多条件VLookup    多值VLookup  |   跨多个工作表的 VLookup   |   模糊查询 ....
高级下拉列表: 快速创建下拉列表   |  依赖下拉列表   |  多选下拉列表 ....
列管理器: 添加特定数量的列  |  移动列  |  切换隐藏列的可见性状态  |  比较范围和列 ...
特色功能: 网格焦点   |  设计图   |   大方程式酒吧    工作簿和工作表管理器   |  资源库 (自动文本)   |  日期选择器   |  合并工作表   |  加密/解密单元格    按列表发送电子邮件   |  超级筛选   |   特殊过滤器 (过滤粗体/斜体/删除线...)...
前 15 个工具集12 文本 工具 (添加文本, 删除字符,...)   |   50+ 图表 类型 (甘特图,...)   |   40+ 实用 公式 (根据生日计算年龄,...)   |   19 插入 工具 (插入二维码, 从路径插入图片,...)   |   12 转化 工具 (小写金额转大写, 货币兑换,...)   |   7 合并与拆分 工具 (高级组合行, 分裂细胞,...)   |   ... 和更多

使用 Kutools for Excel 增强您的 Excel 技能,体验前所未有的效率。 Kutools for Excel 提供了 300 多种高级功能来提高生产力并节省时间。  单击此处获取您最需要的功能...

产品描述


Office Tab 为 Office 带来选项卡式界面,让您的工作更加轻松

  • 在Word,Excel,PowerPoint中启用选项卡式编辑和阅读,发布者,Access,Visio和Project。
  • 在同一窗口的新选项卡中而不是在新窗口中打开并创建多个文档。
  • 每天将您的工作效率提高50%,并减少数百次鼠标单击!
Comments (7)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Thank you! In order to save space, is it possible to only label the first and last date in the series? I've tried changing the "interval unit" setting under label, but it doesn't seem to have any effect on a multi-level chart. I also tried setting the middle date labels to spaces or blanks, but that completely confused excel.,
This comment was minimized by the moderator on the site
Hi Kathy,
There is another trick that can save space in the X axis in chart.
Select the date cells in the source data, right click, and select Format Cells from context menu. And then customize the date format with the number formatting code m/d
This comment was minimized by the moderator on the site
Thanks @kellyette, I'll give that a try.
This comment was minimized by the moderator on the site
Hello, I am trying to make a graph but I am not able to display data as I need it. I have 5 columns of data. first 3 columns are identifiers (date, location, product), 4th and 5th columns are to compare the sales numbers in a graph. However when I select the columns I only get location as vertical text on horizontal axis and date and product data is showing as horizontal text and gets all scrambled. I tried changing the text direction but it did not work. How can I have date, location, product information next to each other for each date, displaying vertically under each comparison data? Thanks in advance for your help. AJ
This comment was minimized by the moderator on the site
Hi aj,
Which version of Excel are you using? And which chart type are you creating? In Excel 2013, select 5 columns, and then click Insert > Insert Column Chart > Clustered Column, the first 3 columns will be added as x axis automatically.
This comment was minimized by the moderator on the site
I have this same problem. You can only rotate the upper level of labels. The 2nd level will always be Horizontal (or Vertical on the Y-axis). I can't figure a way to change it either.
This comment was minimized by the moderator on the site
merging cells makes the table un-usable. Might as well use powerpoint instead of a table.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations