1

現在、Dev Extreme を使用して、AngularJS で構築された単一ページの Web アプリケーションでいくつかのグラフを生成しています。Documentation-DevExtremeのチュートリアルに従って、そのようなテンプレートを作成しました。コントローラー内に書いたことを除いて。
以下は私のコードです:

// This controller manages views in basic.html
app.controller("basicCtrl", ["$scope", "$http",
   function ($scope, $http) {

    function find(str, raw) {}
    $scope.method = "GET";
    $scope.url = "test.json";
    $scope.BindWidget = function () {
        var data = $scope.data;
        // console.log(data);  
        // get data
        var peopleStreamData = find("peopleStream", data);
        if (peopleStreamData !== null) {
            var chartOptions = {
                dataSource: peopleStreamData.dataSource,
                series: peopleStreamData.series,
                scrollBar: {
                    visible: true
                },
                scrollingMode: "all",
                zoomingMode: "all",
            };
            $("#peopleStream").dxChart(chartOptions);

            $("#whatever").dxRangeSelector({
                //some other options here I hid
                behavior: {
                    callSelectedRangeChanged: "onMoving"
                },
                onSelectedRangeChanged: function (e) {
                    var zoomedChart = $("#peopleStream").dxChart('instance');
                    zoomedChart.zoomArgument(e.startValue, e.endValue);
                }
            });
        }
    };

    $scope.fetch = function () {
        $http({method: $scope.method, url: $scope.url, cache: false}).
                success(function (data, status) {
                    $scope.status = status;
                    $scope.data = data;
                    // call the function to generate widgets
                    $scope.BindWidget();
                }).
                error(function (data, status) {
                    console.log("SHIT, FAILED TO READ JSON");
                    $scope.data = data || "Request failed";
                    $scope.status = status;
                });
    };

    $("document").ready($scope.fetch());
}]);

そしてhtml:

<body>
<div id="peopleStream"></div>
<div id="whatever"></div>
</body>

なんらかの理由で、スクロールバーが表示されず、rangeSelector を変更しても、メイン チャートで何も変更されません。誰でもこれを経験したことがありますか?

4

1 に答える 1