SAPUI5表的聚合不起作用

时间:2017-05-15 10:34:49

标签: json aggregate sapui5 graphviz

我是SAPUI5的新用户,我试图在列表图表中显示之前聚合一些JSON数据。

以下是我的代码的几行:

 initMap(): Promise<any> {

    this.mapInitialised = true;//part 1

    return new Promise((resolve) => {


      this.geolocation.getCurrentPosition().then((position) => {// Part 2

   let latLng = new google.maps.LatLng(position.coords.latitude,position.coords.longitude);

        let mapOptions = {
          center: latLng,
          zoom: 15,
          mapTypeId: google.maps.MapTypeId.ROADMAP
        }

        this.map = new google.maps.Map(this.mapElement, mapOptions);
        resolve(true);

      });

    });

  }

实际上一切正常,但应用程序只显示我的xsodata中最后一项的JSON数据。这就是我尝试聚合xsodata文件中数据的原因,如:

var xsodataURL = 'That is my URL to my xsodata';
var oModelBU = new sap.ui.model.odata.ODataModel(xsodataURL, false);
oModelBU.bindList('/PM_PROJECT', false, {
    select: 'PMBudget, PMActual, PMEAC'
});

var oDatasetBU = new sap.viz.ui5.data.FlattenedDataset({
    dimensions: [{
        axis: 1,
        name: 'ProgramID: Overall Result',
        value: ''
    }],

    measures: [
        [{
            name: 'Budget',
            value: '{PMBudget}'
        }, {
            name: 'Actual',
            value: '{PMActual}'
        }, {
            name: 'EAC',
            value: '{PMEAC}'
        }]
    ],

    data: {
        path: '/PM_PROJECT'
    }
});

var oChartBU = new sap.viz.ui5.Column({
    width: '100%',
    height: calcChartHeight,
    legendGroup: {
        layout: {
            position: 'bottom'
        }
    },
    plotArea: {
        colorPalette : d3.scale.category20().range()
    },
    title: {
        visible: true,
        text: 'Budget use in mEUR',
        alignment: 'left'
    },
    dataset: oDatasetBU
});
oChartBU.setModel(oModelBU);

但这不起作用 - 有谁知道,我如何能够显示聚合为表格的总和的所有数据&#34; PM_PROJECTS&#34;?提前谢谢!

祝你有个美好的一天,Arne。

0 个答案:

没有答案