{
"items" : [
{
"Quarter": "Q1",
"MilkCurrYear": "20",
"MilkPrevYear": "30",
"SugarCurrYear": "40",
"SugarPrevYear": "35",
"TeaCurrYear": "48",
"TeaPrevYear": "20"
},
{
"Quarter": "Q2",
"MilkCurrYear": "30",
"MilkPrevYear": "20",
"SugarCurrYear": "10",
"SugarPrevYear": "20",
"TeaCurrYear": "10",
"TeaPrevYear": "5"
},
{
"Quarter": "Q3",
"MilkCurrYear": "35",
"MilkPrevYear": "20",
"SugarCurrYear": "15",
"SugarPrevYear": "20",
"TeaCurrYear": "15",
"TeaPrevYear": "5"
},
{
"Quarter": "Q4",
"MilkCurrYear": "60",
"MilkPrevYear": "20",
"SugarCurrYear": "20",
"SugarPrevYear": "20",
"TeaCurrYear": "20",
"TeaPrevYear": "5"
}
]
}
"sap.ui5": {
…………………………….
"models": {
"i18n": {
"type": "sap.ui.model.resource.ResourceModel",
"settings": {
"bundleName": "Dual_Column_Bar_Chart.i18n.i18n"
}
},
"Data": {
"Data": {
"type": "sap.ui.model.json.JSONModel",
"uri": "model/Data.json"
}
}
},
"resources": {
"css": [{
"uri": "css/style.css"
}]
}
}
<viz:VizFrame xmlns="sap.viz" id="idDualStackedChart" vizType="dual_stacked_column" width="100%"
height="100%" vizProperties="{dataLabel:{ showTotal: true},title:{ text:'Dual Stacked Column Example'}}">
<viz:dataset>
<vizData:FlattenedDataset data="{/items}">
<vizData:dimensions>
<vizData:DimensionDefinition name="Quarter" value="{Quarter}"/>
</vizData:dimensions>
<vizData:measures>
<vizData:MeasureDefinition name="Milk Current Year" value="{MilkCurrYear}"/>
<vizData:MeasureDefinition name="Sugar Current Year" value="{SugarCurrYear}"/>
<vizData:MeasureDefinition name="Tea Current Year" value="{TeaCurrYear}"/>
<vizData:MeasureDefinition name="Milk Previous Year" value="{MilkPrevYear}"/>
<vizData:MeasureDefinition name="Sugar Previous Year" value="{SugarPrevYear}"/>
<vizData:MeasureDefinition name="Tea Previous Year" value="{TeaPrevYear}"/>
</vizData:measures>
</vizData:FlattenedDataset>
</viz:dataset>
<viz:feeds>
<vizFeeds:FeedItem uid="valueAxis" type="Measure" values='Milk Current Year,Sugar Current Year,Tea Current Year'/>
<vizFeeds:FeedItem uid="valueAxis2" type="Measure" values='Milk Previous Year,Sugar Previous Year,Tea Previous Year'/>
<vizFeeds:FeedItem uid="categoryAxis" type="Dimension" values="Quarter"/>
</viz:feeds>
</viz:VizFrame>
onInit: function() {
var sampleDatajson = new sap.ui.model.json.JSONModel("model/Data.json");
this.getView().setModel(sampleDatajson);
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 | |
2 |