0

私が達成しようとしているのは、ユーザーがセレクターをドラッグしたりドラッグしたりするときに 1 か月単位で進むのではなく、ナビゲーター セクションを 1 日単位で表示することです。以下に私のソースを含めました。すべてが機能しますが、ナビゲーターのステップを 1 日に 1 つずつ調整することができません。どんな助けでも大歓迎です。

$.ajax({
    // the url to the service
    url: "/api/TrendAnalysis",
    // the format that the data should be in when
    // it is returned
    contentType: "json",
    // the function that executes when the server
    // responds to this ajax request successfully
    success: function (data) {
        $("#progressBar").toggle();
        trend = data;

        // put the JSON response current and previous data
        // for the selected metric on the stock chart
        trendgraph.element.kendoStockChart({
            theme: trendgraph.theme,
            dataSource: {
                data:trend
            },
            title: {
                text: "Trend Analysis (Traffic)",
                visible: false
            },
            chartArea: {
                background: trendgraph.background
            },
            dateField:  Date.parse(trend.currentdate),
            series: [{
                type: "line",
                field: trendgraph.currentmetric,
                categoryField: trendgraph.currentdate,
                missValues: "zero",
                color: "#1589FF",
                tooltip: {
                    visible: true,
                    template: "TY #=value#"
                }
            }, {
                type: "line",
                field: trendgraph.previousmetric,
                missValues: "zero",
                tooltip: {
                    visible: true,
                    template: "LY #=value#"
                },
                color: "#ff8a14"
            }],
            navigator: {
                //dateField: trendgraph.currentdate,

                categoryAxis: {
                    baseUnit: "days",
                },
                series: [{
                    baseUnit: "fit",
                    categoryField: trendgraph.currentdate,
                    type: "area",
                    field: trendgraph.currentmetric,
                    missingValues: "zero"
                }]
                /*select: {
                    from: trendgraph.from,
                    to: trendgraph.to
                }*/
            },
            valueAxis: {
                labels: {
                    //visible: false,
                    format: trendgraph.format.Number,
                    step: trendgraph.axisstep
                }
            },
            categoryAxis:{
                field: trendgraph.currentdate,
                baseUnit: "fit"
            },
            tooltip: {
                visible: true,
                format: trendgraph.format.Number
            },
            select: Select,
            zoom: Select
        });
    }

    });
function Select(e) {
    displayDateRange(kendo.toString(e.to,'d'), kendo.toString(e.from, 'd'));
}
4

1 に答える 1