如何排除“其他"在我的Data Studio饼图中 [英] How to exclude "others" in my pie chart in Data Studio

查看:103
本文介绍了如何排除“其他"在我的Data Studio饼图中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Data Studio中有一个饼图,如下所示:

I have a pie chart in Data Studio as below:

从甜甜圈中可以看到,有一个其他"切片,我不想在那里看到,我想自定义标签以显示"python(88%)".

As you can see from the donut, there is "others" slice which I don't want to see it there, and I want to customize the label to show "python (88%)".

任何人都可以分享您的专业知识并启发我如何做吗?

Can anyone share your expertise and enlighten me on how to do it?

非常感谢您.

更新

按照@Jaishree的建议,我只选择了前10名,因此现在没有其他".

Following @Jaishree's suggestion, I have selected only the top 10, so there is no "others" now.

但是,关于如何将标签显示为"python(88%)",我仍然不了解

however, I still don't get it on how to show the label as "python (88%)"

如您所见,我的数据源(左侧表)中有两个字段:Category和TagsTotal.没有percent_field.

As you can see, I have two fields in my data source (the table on the left): Category and TagsTotal. There is NO percentage_field.

要显示百分比",我需要做的就是在样式"选项中切换到百分比":

To show "percentage", all I need to do is switch to "percentage" in the STYLE option:

下面为以后的读者详细介绍了我创建此定制标签的最终目的:

What I ended up of creating this customized labeling is detailed below for future readers:

  1. 回到数据源,创建另一个字段pctg:

round((TagsTotal * 100 / (Select Sum(TagsTotal) From cte)),2) as pctg

  1. 对于甜甜圈图,创建一个名为my_label

  1. for the donut chart, create a new field named my_label

CONCAT(类别,(",pctg,%)")

CONCAT(category," (",pctg ,"% )")

将新字段my_label添加为维度"字段

add the new field my_label as the Dimension field

更改样式以显示标签"

change in STYLE to show "label"

Voila!

非常麻烦,但最终可以与其余工作一起进行整理:

Very cumbersome but finally kind of working with the rest to be sorted out:

1.新创建的字段未在右侧面板中显示为可用字段,以及如何对其进行修改?

2.需要自定义图例以显示两行,而不是显示分页

推荐答案

  1. 在饼图和甜甜圈图中,您只能显示20个切片.图表以排序方式显示结果.如果您不想看到其他人,则只能选择20个数据点.

  1. In Pie chart and donuts chart you can only show 20 slices. The chart shows the results in a sorted way. If you do not want to see others, then you have select only 20 data points.

" python(88%)"如果要将标签显示为" python(88%)",则可以添加新字段并自定义您想要的标签. 您可以点击"创建新字段",然后单击添加新字段",然后在公式中为新字段命名,输入以下代码:

"python (88%)" If you want to show the labels as "python (88%)" you can add a new field and customize the labels as you want. You can do that by click on "create new field " then "add new field" and then give a name to the new field in formula type the below code:

CONCAT(category," (",percentage_field,"% )")

要使用上述公式,您还必须在之前创建一个percentage_field,方法与百分比公式相同.

To use the above formula you have to create a percentage_field also before, in the same way with percentage formula.

这篇关于如何排除“其他"在我的Data Studio饼图中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆