图例中不显示图例。我尝试了几种技巧,但传说不会出现。有人可以帮忙吗?
const textCustomSetter = (newValue, newComponent) => {
newComponent.properties.Text = newValue;
//split on one or more slashes before an n, keep the delimiter
var arr = newValue.split(/(\\{1,}n)/g);
for (var i = 0; i < arr.length; i++) {
if (arr[i] == "\\n") {
//address the newline
arr[i] = "\n";
}
//everything else, gets one slash reduced
if (arr[i].match(/\\{2,}n/g)){
arr[i] = arr[i].substr(1);
}
}
newComponent.properties.children = arr;
};