|
@@ -138,6 +138,19 @@ export default {
|
|
|
barGap: 18,
|
|
|
barWidth: 18,
|
|
|
data: c.data,
|
|
|
+ label: {
|
|
|
+ show: true,
|
|
|
+ position: "top",
|
|
|
+ fontSize: "10",
|
|
|
+ color: "#fff",
|
|
|
+ formatter: function (params) {
|
|
|
+ if (params.value === 0) {
|
|
|
+ return ''; // 或者 return null;
|
|
|
+ }
|
|
|
+ // 如果不为0,则按需要返回标签内容
|
|
|
+ return params.value;
|
|
|
+ }
|
|
|
+ },
|
|
|
itemStyle: { color: { type: 'linear', x: 0, x2: 1, y: 0, y2: 0, colorStops: color[i] } },
|
|
|
}, {
|
|
|
z: i + 10,
|
|
@@ -149,6 +162,7 @@ export default {
|
|
|
data: diamondData[i],
|
|
|
itemStyle: { color: color2[i] },
|
|
|
tooltip: { show: false },
|
|
|
+
|
|
|
})
|
|
|
|
|
|
// 是否最后一个了?
|
|
@@ -163,6 +177,7 @@ export default {
|
|
|
symbolSize: [18, 10],
|
|
|
itemStyle: { color: { type: 'linear', x: 0, x2: 1, y: 0, y2: 0, colorStops: color[0] } },
|
|
|
tooltip: { show: false },
|
|
|
+
|
|
|
})
|
|
|
return p
|
|
|
}
|