Skip to Content
avatar image
Former Member

Aggregation binding not working in AreaMicroChart

I have bound JSONModel with sap.suite.ui.microchart.AreaMicroChart control to show points in lines aggregation but chart is not rendering.

Plese tell me whats wrong in below XML code:

<micro:AreaMicroChart lines="{/}" id="areaMicroChart" isResponsive="true" minXValue="0" app:name="area" maxXValue="12" minYValue="0" maxYValue="999999" colorPalette="#b6d957" press="press">
    <micro:firstXLabel>
        <micro:AreaMicroChartLabel label="Jan" />
    </micro:firstXLabel>
    <micro:lastXLabel>
        <micro:AreaMicroChartLabel label="Dec" />
    </micro:lastXLabel>
    <micro:firstYLabel>
        <micro:AreaMicroChartLabel label="" color="Good" />
    </micro:firstYLabel>
    <micro:lastYLabel>
        <micro:AreaMicroChartLabel label="" />
    </micro:lastYLabel>
    <micro:lines>
        <micro:AreaMicroChartItem points="{path: 'aPrev', templateShareable: 'true' }">
            <micro:points>
                <micro:AreaMicroChartPoint x="{a}" y="{ZtotalSales}" />
            </micro:points>
        </micro:AreaMicroChartItem>
    </micro:lines>

</micro:AreaMicroChart>
JS Code:
onInit: function() {
    var aPrevMonths = [{
        ZtotalSales: "2123",
        a: "1"
    }, {
        ZtotalSales: "55545",
        a: "2"
    }, {
        ZtotalSales: "34342",
        a: "3"
    }];
    var oModel = new JSONModel({
        aPrev: aPrevMonths

    });
    this.byId("areaMicroChart").setModel(oModel);
}
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers