WeeklyAlteryxTips#74 Show the total at the center of the Interactive Chart tool’s pie chart

Alteryx

This blog series is a weekly AlteryxTips blog that will provide you with Alteryx tips every week.

Last week, I explained about the similar way, but this week’s way is more complex than last week tips.

Normal Pie Chart by Interactive Chart tool

This is the normal Pie Chart by the Interactive Chart tool. This donuts type chart is easy to create.

The setting for the this chart is as follows.

The “Labels” divides the Values. So, I set the item column as “Labels” this time. In other words, the values(“sales” column) is summarized by each item column values. Therefore the “Transforms” option is disabled.

By the way, the centor hole is controled by the “Hole” option at the STYLE “Layer” tab.

In this post, I would like to explain how to use this part of the hole.

How to show the total at the hole part

To utilize this hole, there are some ways.

  1. Overlay two pie chart
  2. Overlay the bar chart behind the pie chart
  3. Use the Overlay tool

Regarding to the method 1st, overlaying 2 pie charts is bery easy, but the color of the hole could not be changed white. This is the result of the 1st way.

However, you can change the color with editing the XML. This way would be shown by this blog in the future.

Regarding to the method 3rd, I will explain it at the next blog.

At this blog, I would like to make the combination pie chart only using the Interactive Chart tool.

Preparing the data for the pie chart with the total

The data preparation is needed in advance. To show at the center of the pie chart using the bar chart, two records are needed. One is 1 for Y-axis and 1 for X-axis and another is 2 for Y-axis and 1 for X axis(the value for X-axis is fixed number). This is as follows.

I create a workflow for this purpose as follows.

The data in the Text Input tool is as follows.

At the Summarize tool, “sales” is just aggregated.

Next, the records which is made by Summarize tool are increased to 2. Create Y-Position and make 2 records.

And then, I create the “X-Position” column which has the fixed value and label. That label has if the “Y-Position” value is 1 else has empty value.

After that, join by the record position at the Join Multiple tool.

The result is as follows.

If you use the Join tool, the result is limited 2 records, so I use the Join Multiple tool. Note that the Join tool only output records that join from all inputs.

The Interactive Chart setting

Let’s set the Interactive Chart tool.

First, set the pie chart. This setting is normal.

Next, set the bar chart. I named it as “Center Total”.

  • Type : Bar
  • X : “X-Position”
  • Y : “Y-Position”

Next, go to the detail setting for the pie chart. About the Layer tab, the size of the hole is set at the “Hole” and label detail is set at the “SLICE LABEL”.

If you want to change the font size, you can change it at the “Size” on the “Font” tab. The default font size is too small for me, so I always change it.

Next, set the setting for the bar chart. It is needed for adjusting the detail.

Go to the “Center Total” on the “STYLE” Layer tab. “Center Total” is named by you created the bar chart at the “CREATE” Layer tab.

  • Opacity % : 0
  • Text : “Label”
  • Text Position : Outside
  • Size Pixcel : I think the large size is better.

The ledend is not needed, so you should select “Hide” at the SHOW IN LEGEND. And also “HOVER TEXT” is not needed.

And then, hide the x and y axis. Those options are on the Axes tab.

  • Lines : All
  • AXIS LINE : Hide
  • GRID LINES : Hide
  • Labels : All
  • LABELS : Hide

However, there is still x axis line.

To hide this, adjust the “Bottom Pixel” at the Chart tab. 0 is good value for this purpose.

The result is as follows. Congratulations!!!

Conclusion

  • I have explained the way that creating the hole and position the label in that hole.
  • The setting of the pie chart is normal setting and overlay the bar chart and show the label of the bar chart.
  • The preparation of the data is needed for this purpose.

Sample Workflow download

The next blog is …

I would like to explain the same thing using the Overlay tool.

コメント

Copied title and URL