How to exclude “others” in my pie chart in Data Studio

久未见 提交于 2020-02-25 04:17:32

问题


I have a pie chart in Data Studio as below:

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?

Thank you very much.

UPDATE

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

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

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. Back to the data source, create another field pctg:

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

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

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

  2. add the new field my_label as the Dimension field

  3. change in STYLE to show "label"

Voila!

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

1. The newly created field is not showing up in the right-side panel as an available field and how to modify it?

2. The legend needs to be customized to display two lines instead of showing a pagina


回答1:


  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.

  2. "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,"% )")

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



来源:https://stackoverflow.com/questions/60243829/how-to-exclude-others-in-my-pie-chart-in-data-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!