如何将json模型值绑定到VizChart的参考线值?

时间:2018-07-24 12:44:57

标签: json user-interface charts sap

我正在尝试在我的VizChart中显示参考线。 如果我只输入一个固定值,这会很好,但是尝试将值绑定到我的模型时失败了。

这很好:

plotArea: {
                referenceLine: {
                    line: {
                        valueAxis: [{
                            value: 80,
                            visible: true,
                            label: {
                                text: "Target",
                                visible: true
                            }
                        }]
                    }
                }
            }

这不起作用:

plotArea: {
                    referenceLine: {
                        line: {
                            valueAxis: [{
                                value: "{SpecialFeedTrendSet>/Rowsets/Rowset/0/Row/0/Target}",
                                visible: true,
                                label: {
                                    text: "Target",
                                    visible: true
                                }
                            }]
                        }
                    }
                }

我的模型如下:

{ "Rowsets" : { 
    "DateCreated" : "2018-05-14T11:54:09", "Version" : "15.2 SP0 Patch 3 (26.04.2018)", "StartDate" : "2018-05-14T10:54:09+0200", "EndDate" : "2018-05-14T11:54:09+0200", "CachedTime" : "", 
    "Rowset" : [ 
    { "Columns" : { 
        "Column" : [ 
        { "Name" : "ID", "SourceColumn" : "ID", "Description" : "ID", "SQLDataType" : 1, "MinRange" : 100.0, "MaxRange" : 100.0 }, 
        { "Name" : "Hour", "SourceColumn" : "Hour", "Description" : "Hour", "SQLDataType" : 1, "MinRange" : 100.0, "MaxRange" : 100.0 },
        { "Name" : "C", "SourceColumn" : "C", "Description" : "C", "SQLDataType" : 1, "MinRange" : 100.0, "MaxRange" : 100.0 },
        { "Name" : "Target", "SourceColumn" : "Target", "Description" : "Target", "SQLDataType" : 1, "MinRange" : 100.0, "MaxRange" : 100.0 },
        { "Name" : "Trend", "SourceColumn" : "Trend", "Description" : "Trend", "SQLDataType" : 1, "MinRange" : 100.0, "MaxRange" : 100.0 },
        { "Name" : "Average", "SourceColumn" : "Average", "Description" : "Average", "SQLDataType" : 1, "MinRange" : 100.0, "MaxRange" : 100.0 } ] }, 
    "Row" : [ 
        {"ID":"1","Hour":11,"C":"80.8","Target":"90.0","Trend":"90.0","Average":"103.6"},
        {"ID":"2","Hour":12,"C":"109.5","Target":"90.0","Trend":"100.0","Average":"103.6"} ]
         } ]
     }
 }

谁能告诉我要使绑定生效,我需要更改什么?

谢谢, G.S。

0 个答案:

没有答案