fix: 看板参数可能为null编译检查不过
This commit is contained in:
@@ -98,7 +98,7 @@ const optionData: EChartsOption = {
|
|||||||
itemStyle: {
|
itemStyle: {
|
||||||
color: function (params) {
|
color: function (params) {
|
||||||
// 红色
|
// 红色
|
||||||
if (+params.value >= 70) {
|
if (params.value && +params.value >= 70) {
|
||||||
return new echarts.graphic.LinearGradient(0, 0, 1, 0, [
|
return new echarts.graphic.LinearGradient(0, 0, 1, 0, [
|
||||||
{ offset: 0, color: '#fff1f0' },
|
{ offset: 0, color: '#fff1f0' },
|
||||||
{ offset: 0.5, color: '#ffa39e' },
|
{ offset: 0.5, color: '#ffa39e' },
|
||||||
@@ -106,7 +106,7 @@ const optionData: EChartsOption = {
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
// 蓝色
|
// 蓝色
|
||||||
if (+params.value >= 30) {
|
if (params.value && +params.value >= 30) {
|
||||||
return new echarts.graphic.LinearGradient(0, 0, 1, 0, [
|
return new echarts.graphic.LinearGradient(0, 0, 1, 0, [
|
||||||
{ offset: 0, color: '#f0f5ff' },
|
{ offset: 0, color: '#f0f5ff' },
|
||||||
{ offset: 0.5, color: '#adc6ff' },
|
{ offset: 0.5, color: '#adc6ff' },
|
||||||
@@ -161,9 +161,9 @@ const optionData: EChartsOption = {
|
|||||||
label: {
|
label: {
|
||||||
formatter: params => {
|
formatter: params => {
|
||||||
var text = `{a| ${params.value}%} `;
|
var text = `{a| ${params.value}%} `;
|
||||||
if (+params.value >= 70) {
|
if (params.value && +params.value >= 70) {
|
||||||
text = `{c| ${params.value}%} `;
|
text = `{c| ${params.value}%} `;
|
||||||
} else if (+params.value >= 30) {
|
} else if (params.value && +params.value >= 30) {
|
||||||
text = `{b| ${params.value}%} `;
|
text = `{b| ${params.value}%} `;
|
||||||
}
|
}
|
||||||
return text;
|
return text;
|
||||||
|
|||||||
Reference in New Issue
Block a user