Helo all im 将类似 JSON 的数据格式设置为 ne 由名为 fusioncharts 的 JS 库使用。
底部是一个名为“数据”的部分,其中第二个对象发生错误:totalFundedValue
好的,这是我渲染的 HTML 的片段:
var totalFunded = '109321734.06';
var totalFundedValue;
var totalFundedLabel;
var totalFundedText;
if (totalFunded != null)
{
totalFundedLabel.push({ "label": "Funded",});
totalFundedValue.push({"value": "109321734.06"});
totalFundedText.push({"toolText": "$109,321,734.06"});
}
"data":[{
totalFundedLabel
totalFundedValue
totalFundedText
}
]
JS:
var totalFunded = '${totalFunded}';
var totalFundedValue;
var totalFundedLabel;
var totalFundedText;
if (totalFunded != null)
{
totalFundedLabel.push({ "label": "Funded",});
totalFundedValue.push({"value": <tld-msst:fc-value var="${totalFunded}"/>,});
totalFundedText.push({"toolText": "<fmt:formatNumber value='${totalFunded}' type='currency' groupingUsed='true' />"});
}
只是为了澄清,这是不使用 push 方法的样子:
data: [{
"label":"Funded",
"value":"${totalFunded}",
"toolText": "<fmt:formatNumber value='${totalFunded}' type='currency' groupingUsed='true' />"
},