2017-08-31 65 views

回答

0

謝謝你的工作&時間! ..我已經使用setVizProperties> plotArea> dataPointStyle>規則。它是更新的link

1

我認爲你正在尋找條形圖來顯示金額與天數

這裏是working link.

我有如下更新_setupChart方法。

_setupChart: function() { 
    var oVizFrame = this.getView().byId("idVizFrame"); 
    oVizFrame.setModel(new JSONModel('./data.json')); 
    var oDataset = new sap.viz.ui5.data.FlattenedDataset({ 
     dimensions: [{ 
      name: "Days", 
      value: "{Days}" 
     }], 
     measures: [{ 
      name: "Amount", 
      value: "{Amount}" 
     }], 
     data: { 
      path: "/dueDays" 
     } 
    }); 
    oVizFrame.setDataset(oDataset); 
    oVizFrame.setVizType('bar'); 
    var feedValueAxis = new sap.viz.ui5.controls.common.feeds.FeedItem({ 
     "uid": "valueAxis", 
     "type": "Measure", 
     "values": ["Amount"] 
    }); 
    var feedCategoryAxis = new sap.viz.ui5.controls.common.feeds.FeedItem({ 
     "uid": "categoryAxis", 
     "type": "Dimension", 
     "values": ["Days"] 
    }); 
    oVizFrame.addFeed(feedValueAxis); 
    oVizFrame.addFeed(feedCategoryAxis); 
} 

,也是我已經更新了JSON數據如下

{ 
    "dueDays": [{ 
     "Days": "Current", 
     "Amount": "44334.00" 
     }, {   
     "Days": "1 to 30", 
     "Amount": "53454.00" 
     }, {   
     "Days": "31 to 60", 
     "Amount": "34443.65" 
     }, {   
     "Days": "61 to 90", 
     "Amount": "65554.43" 
     }, {   
     "Days": "91 to 120", 
     "Amount": "43524.00" 
     },{   
     "Days": "121 to 150", 
     "Amount": "54554.00" 
     }, {   
     "Days": "151 to 180", 
     "Amount": "43324.00" 
     }, {   
     "Days": "Above 180", 
     "Amount": "54355" 
    }] 
} 
+0

謝謝!但我需要酒吧用不同的顏色作爲附加的圖像。 – Hari

+0

我正在努力,當它完成後我會更新。 –

+0

感謝您花費寶貴的時間! – Hari

相關問題