来自数据透视表列的Excel饼图

时间:2022-09-15 21:17:19

I have a pivot table from a database that looks something like this:

我有一个来自数据库的数据透视表,看起来像这样:

         Person A       Person B        Person C

Task A      1                               3  
Task B                      1               2 
Task C      2               1.5             1

The number is time spent on a task. If it's blank, the person didn't work on that task.

该数字是在任务上花费的时间。如果它是空白的,则该人员不会执行该任务。

I would like to make a pie chart for each Person from the pivot table for time spent on each task, not including tasks where the cell is blank. I've tried adding various flavours of pie charts but it only ever creates the chart on the first column of the table. And when it does that, it seems to include empty cells in its key (though obviously not on the pie).

我想从数据透视表中为每个人制作一个饼图,用于每个任务所花费的时间,不包括单元格为空的任务。我尝试添加各种风格的饼图,但它只在表格的第一列创建了图表。当它这样做时,它似乎在其键中包含空单元格(尽管显然不在饼图上)。

Does anyone know anything about this?

有人对这个有了解吗?

1 个解决方案

#1


Generally, the Pivot Chart will attempt to plot whatever is in the Pivot Table (including all column titles). I think the easiest way to deal with this is to add a Slicer so that you can select the Person and have it filter the data for you. Alternatively, you can filter the Pivot Table on your own, but the Slicer is quite clean in this application.

通常,数据透视表将尝试绘制数据透视表中的任何内容(包括所有列标题)。我认为解决这个问题最简单的方法是添加一个切片器,以便您可以选择Person并让它为您过滤数据。或者,您可以自己过滤数据透视表,但切片器在此应用程序中非常干净。

I don't think it is possible to get multiple pie charts inside a single chart. You could use the doughnut plot if you want to see all columns plotted at once. Visually, that chart is horrible to interpret though.

我不认为在单个图表中获得多个饼图是不可能的。如果要查看一次绘制的所有列,可以使用圆环图。从视觉上看,这张图表虽然很难理解。

Here is something similar to your data with the Slicer in place for person B. Note that the legend cleans up also since the missing keys have been filtered out of the Pivot Table itself.

这里有类似于你的数据的东西,适用于人B的切片器。请注意,由于缺少的键已从数据透视表本身过滤掉,因此图例也会清除。

来自数据透视表列的Excel饼图

#1


Generally, the Pivot Chart will attempt to plot whatever is in the Pivot Table (including all column titles). I think the easiest way to deal with this is to add a Slicer so that you can select the Person and have it filter the data for you. Alternatively, you can filter the Pivot Table on your own, but the Slicer is quite clean in this application.

通常,数据透视表将尝试绘制数据透视表中的任何内容(包括所有列标题)。我认为解决这个问题最简单的方法是添加一个切片器,以便您可以选择Person并让它为您过滤数据。或者,您可以自己过滤数据透视表,但切片器在此应用程序中非常干净。

I don't think it is possible to get multiple pie charts inside a single chart. You could use the doughnut plot if you want to see all columns plotted at once. Visually, that chart is horrible to interpret though.

我不认为在单个图表中获得多个饼图是不可能的。如果要查看一次绘制的所有列,可以使用圆环图。从视觉上看,这张图表虽然很难理解。

Here is something similar to your data with the Slicer in place for person B. Note that the legend cleans up also since the missing keys have been filtered out of the Pivot Table itself.

这里有类似于你的数据的东西,适用于人B的切片器。请注意,由于缺少的键已从数据透视表本身过滤掉,因此图例也会清除。

来自数据透视表列的Excel饼图