三角图就是有三个轴的坐标图,可以分别表示一个点在X、Y、Z三个维度上的不同比例情况。
与传统的XY坐标轴不同。XY坐标轴是有两个维度,而且每个维度没有上下限的限制。三角图中每个维度都在0-1的范围内,按百分比划分,即最小0%,最大100%。我们的数据点都会分布在这个三角区域内。
与传统XY坐标相比的好处是,在比较数据点之间的关系时,我们可以增加多一个维度。方便查看数据点之间的关系。
而实现的原理就是通过三角函数,将三元图的坐标点转换为XY轴坐标。从下图可以看出,每个点都可以通过辅助线,画一个新的等边三角形,从而求出该点在XY轴的位置。

放一个好看的案例在这里: 
导入样本数据Superstore之后,逐个创建计算字段:
#Percentage of Total Orders
COUNTD([Order ID])/TOTAL(COUNTD([Order ID]))#Percentage of Total Quantity
SUM([Quantity]) / TOTAL(SUM([Quantity]))#Percentage of Total Sales
SUM([Sales]) / TOTAL(SUM([Sales]))
#Total Percentages
[Percentage of Total Orders]+[Percentage of Total Quantity]+[Percentage of Total Sales]
#Ternary Value: Quantity
[Percentage of Total Quantity]/[Total Percentages]#Ternary Value: Orders
[Percentage of Total Orders]/[Total Percentages]#Ternary Value: Sales
[Percentage of Total Sales]/[Total Percentages]
#Y
SIN(RADIANS(60))*[Ternary Value: Quantity]#X
[Ternary Value: Orders]+([Y]/TAN(RADIANS(60)))
设置一个参数去控制指标值的颜色和大小。

2. 创建Metric、Color两个参数:
#Metric
IF [Metric Parameter] = "Sales" THENSUM([Sales])
ELSEIF [Metric Parameter] = "Quantity" THENSUM([Quantity])
ELSECOUNTD([Order ID])
END#Color
IF [Ternary Value: Quantity]>[Ternary Value: Orders] AND [Ternary Value: Quantity]> [Ternary Value: Sales] THEN"Quantity"
ELSEIF [Ternary Value: Orders]> [Ternary Value: Quantity] AND [Ternary Value: Orders] >[Ternary Value: Sales] THEN"Orders"
ELSE"Sales"
END

将X轴和Y轴的范围都设置成0到1,把轴标题删除掉

颜色这里要调整透明度,令图案不会重叠覆盖。

“设置线格式”——“工作表”——“线”——“网格线"选项调整为"无”

点击工具提示进行格式编辑,将提示工具编辑一下,删除不用的信息。


添加背景有两种方式:第一种直接导入背景图片;第二种就是另外导入数据,用画多边形的方式画图,在搭建仪表板时候选择"浮动"模式,像是制作PPT图像一样,将两个工作表叠在一起。这里只介绍最方便实用的第一种方法。




计算原理和实现过程: https://www.flerlagetwins.com/2019/08/ternary.html
Superstore案例看板链接:https://public.tableau.com/app/profile/toan.hoang/viz/TernaryChart_15628715360680/TernaryPlot
Superstore原教程:https://tableau.toanhoang.com/creating-ternary-plots-in-tableau/
ternary graph视频教程:https://www.vizwiz.com/2021/04/ternary-graph.html