bugfix> sapui5 > 投稿

作成したいvizframe タイプのチャートdual_timeseries_combination しかし、いくつかの問題が発生しました。 sapui5から参照しました探検した おそらくソースと同じコードを保持しましたが、アプリケーションシステムを実行するとエラーが発生します。

[50053] - Incomplete dimensions binding.

表示中のvizframeチャートのレンダリングの問題を特定して解決するのを手伝ってください。

xyz.view.xml

<viz:Popover id="idPopOver1"></viz:Popover>
<viz:VizFrame 
    id="idVizFrame1" 
    uiConfig="{applicationSet:'fiori'}"
    height='16rem' 
    width="100%" 
    vizType='dual_timeseries_combination'>
    <viz:dataset>
        <viz.data:FlattenedDataset 
            data="{viewModel>/vizData1}">
            <viz.data:dimensions>
                <viz.data:DimensionDefinition 
                    name="Date"
                    value="{Date}"
                    dataType="date" />
            </viz.data:dimensions>
            <viz.data:measures>
                <viz.data:MeasureDefinition 
                    name="Revenue"
                    value="{Revenue}" />
                <viz.data:MeasureDefinition 
                    name="Cost"
                    value="{Cost}" />
            </viz.data:measures>
        </viz.data:FlattenedDataset>
    </viz:dataset>
    <viz:feeds>
        <viz.feeds:FeedItem 
            uid="valueAxis" 
            type="Measure"
            values="[Revenue, Cost]" />
        <viz.feeds:FeedItem 
            uid="timeAxis" 
            type="Dimension"
            values="[Date]" />
    </viz:feeds>
</viz:VizFrame>

xyz.controller.js

onInit : function () {
     var oViewModel;
     oViewModel = new JSONModel({
        vizData1 : [
            { "Date": "12/9/2012", "Revenue": 1884613.732, "Cost": 318748.33 },
            { "Date": "12/10/2012", "Revenue": 4682139.01563249, "Cost": 724396.2295 },
            { "Date": "12/11/2012", "Revenue": 3487569.9375, "Cost": 172863.976 },
            { "Date": "12/12/2012", "Revenue": 1046946.00408699, "Cost": 544135.4995 },
            { "Date": "12/13/2012", "Revenue": 1230392.932, "Cost": 467009.594 },
            { "Date": "12/14/2012", "Revenue": 1633524.08, "Cost": 214320.01 },
            { "Date": "12/15/2012", "Revenue": 1235093.22603004, "Cost": 345418.05 },
            { "Date": "12/16/2012", "Revenue": 1251657.04, "Cost": 730441.86 },
            { "Date": "12/17/2012", "Revenue": 1702039.7007113, "Cost": 237474.96 },
            { "Date": "12/18/2012", "Revenue": 2688478.71, "Cost": 631441.19 },
            { "Date": "12/19/2012", "Revenue": 4405105.20883591, "Cost": 355841.326666667 },
            { "Date": "12/20/2012", "Revenue": 2784207.65540919, "Cost": 440651.7895 },
            { "Date": "12/21/2012", "Revenue": 4935443.7925, "Cost": 839335.0875 },
            { "Date": "12/22/2012", "Revenue": 2351452.9805, "Cost": 348700.144 },
            { "Date": "12/23/2012", "Revenue": 2389202.283, "Cost": 364298.4475 },
            { "Date": "12/24/2012", "Revenue": 2526567.4655, "Cost": 442957.047 },
            { "Date": "12/25/2012", "Revenue": 4992077.4605, "Cost": 825631.82 },
            { "Date": "12/26/2012", "Revenue": 2642847.69879874, "Cost": 443445.405 },
            { "Date": "12/27/2012", "Revenue": 4553299.2245, "Cost": 794032.6225 },
            { "Date": "12/28/2012", "Revenue": 2884613.732, "Cost": 418748.33 },
            { "Date": "12/29/2012","Revenue": 3682139.01563249, "Cost": 524396.2295 },
            { "Date": "12/30/2012", "Revenue": 3187569.9375, "Cost": 472863.976 },
            { "Date": "12/31/2012", "Revenue": 2046946.00408699, "Cost": 344135.4995 },
            { "Date": "1/1/2013", "Revenue": 3230392.932, "Cost": 467099.594 },
            { "Date": "1/2/2013", "Revenue": 1733524.08, "Cost": 274320.01 },
            { "Date": "1/3/2013", "Revenue": 2235093.22603004, "Cost": 245418.05 },
            { "Date": "1/4/2013", "Revenue": 4251657.04, "Cost": 739441.86 },
            { "Date": "1/5/2013", "Revenue": 3702039.7007113, "Cost": 637474.96 },
            { "Date": "1/6/2013", "Revenue": 3688478.71, "Cost": 639441.19 },
            { "Date": "1/7/2013", "Revenue": 3405105.20883591, "Cost": 555841.326666667 },
            { "Date": "1/8/2013", "Revenue": 4459242.84574778, "Cost": 748885.11 },
            { "Date": "1/9/2013", "Revenue": 3189469, "Cost": 568303.033333333 },
            { "Date": "1/10/2013", "Revenue": 3004443.98688375, "Cost": 560890.43 }
        ]
    });
    this.setModel(oViewModel, "viewModel");
    var oVizFrame = this.getView().byId("idVizFrame1");
    oVizFrame.setVizProperties({
        plotArea: {
            window: {
                start: "firstDataPoint",
                end: "lastDataPoint"
            },
            dataLabel: {
                formatString:ChartFormatter.DefaultPattern.SHORTFLOAT_MFD2,
                visible: false
            }
        },
        valueAxis: {
            visible: true,
            label: {
                formatString:ChartFormatter.DefaultPattern.SHORTFLOAT
            },
            title: {
                visible: false
            }
        },
        timeAxis: {
            title: {
                visible: false
            },
            interval : {
                unit : ''
            }
        },
        title: {
            visible: false
        },
        interaction: {
            syncValueAxis: false
        }
    });
    var oPopOver = this.getView().byId("idPopOver1");
    oPopOver.connect(oVizFrame.getVizUid());
}

期待される

回答 1 件
  • 私は自分のプログラムに次のコードを追加する必要があり、それはうまくいきました

    js

    oVizFrame.setVizProperties({
        plotArea: {
            window: {
                start: "firstDataPoint",
                end: "lastDataPoint"
            },
            dataLabel: {
                formatString:ChartFormatter.DefaultPattern.SHORTFLOAT_MFD2,
                visible: false
            }
        },
        valueAxis: {
            visible: true,
            label: {
                formatString:ChartFormatter.DefaultPattern.SHORTFLOAT
            },
            title: {
                visible: false
            }
        },
        valueAxis2: {
            visible: true,
            label: {
                formatString:ChartFormatter.DefaultPattern.SHORTFLOAT
            },
            title: {
                visible: false
            }
        },
        timeAxis: {
            title: {
                visible: false
            },
            interval : {
                unit : ''
            }
        },
        title: {
            visible: false
        },
        interaction: {
            syncValueAxis: false
        }
    });
    
    

あなたの答え