[
{ "Title": "呼吸 次/分", "Name": "chartBreathing", "StartDateKeyword": null, "AfterOperaDaysFromZero": true, "PreserveStartKeywordOrder": false, "LayoutType": "Normal", "TickStep": "1", "TickLineVisible": true, "ValueType": "TickText", "SpecifyHeight": "0", "AutoHeight": false, "TextFontName": null, "TextFontSize": null, "LoopTextList": null, "UpAndDownTextType": "None", "TitleAlign": "Center", "SpecifyTitleWidth": "0", "PageTitleTexts": null },
{ "Title": "大便 次/日", "Name": "billShitCount", "StartDateKeyword": null, "AfterOperaDaysFromZero": true, "PreserveStartKeywordOrder": false, "LayoutType": "Normal", "TickStep": "6", "TickLineVisible": true, "ValueType": "TickText", "SpecifyHeight": "0", "AutoHeight": false, "TextFontName": null, "TextFontSize": null, "LoopTextList": null, "UpAndDownTextType": "None", "TitleAlign": "Center", "SpecifyTitleWidth": "0", "PageTitleTexts": null }
]
使用前端javascript把所有属性值为null和undefined删除掉
let chartData = [];
chartData.forEach(
function(item) {
for (let key in item) {
if (item.hasOwnProperty(key) && (item[key] === null || item[key] === undefined)) {
delete item[key];
}
}
}
);
console.log(chartData);