"interpolate" not working for stacked charts if CategoryAxis is of type Date

3 posts, 0 answers
  1. Adrian
    Adrian avatar
    1 posts
    Member since:
    Aug 2012

    Posted 04 Sep 2012 Link to this post

    I have the following code:

    var threshold = 100;
    var throughputPer10min = [ 15, 26, 21,  40,  63,
                               16, 38, 79, 120,  54,
                               12, 56, 75, 102, 110,
                              130, 90, 75,  50,   5];
     
    var startDate = new Date();
    var chartData = [];
     
     
    for (i = 0; i < throughputPer10min.length; i++) {
        var date = new Date(startDate);
        date.setMinutes(startDate.getMinutes() + (10 * i));
     
        chartData.push({
            "time": date,
            "threshold": threshold,
            "actual": throughputPer10min[i],
            "below": Math.min(throughputPer10min[i], threshold),
            "above": Math.max(0, throughputPer10min[i] - threshold)
        });
    }
     
    var endDate = chartData[chartData.length - 1].time;
    chartData[chartData.length - 1].threshold = threshold;
     
     
    $("#testGraph").kendoChart({
        dataSource:
            {
                data: chartData
            },
        valueAxis:
            {
                majorUnit: 50,
                min: 0,
                max: 150
            },
        categoryAxis:
            {
                field: "time",
                baseUnit: "minutes",
                type: "Date",
                majorGridLines:
                    {
                        visible: false
                    },
                majorTicks:
                    {
                        visible: false
                    },
                labels:
                    {
                        step: 20
                    }
            },
            series: [
            {
                type: "area",
                stack: true,
                missingValues: "interpolate",
                field: "below",
                color: "#55F",
                line: { color: "blue" },
            },
            {
                type: "area",
                stack: true,
                missingValues: "interpolate",
                field: "above",
                color: "green"
            },
             
            {
                type: "line",
                field: "actual",
                missingValues: "interpolate",
                width: 1,
                markers:
                {
                    size: 0
                },
                name: "Actual Throughput"
            },
            {
                type: "line",
                field: "threshold",
                missingValues: "interpolate",
                name: "threshold",
                color: "red",
                dashType: "dash",
                width: 1.5,
                markers:
                {
                    size:0
                },
                name: "Threshold line"
            }
        ],
        legend: {
            visible: false
        }
    });


    if I replace the date.setMinutes(startDate.getMinutes() + (10 * i));  with getMinutes() + i, everything looks fine, otherwise, it looks as if I had used missingValues: "zero"


    Is this a bug or intended ?
  2. T. Tsonev
    Admin
    T. Tsonev avatar
    2815 posts

    Posted 05 Sep 2012 Link to this post

    Hi,

    This is definitely a bug. The chart shouldn't assume 0 for missing values in stacked charts.

    We're working on a fix and it should be available by the end of next week. We'll notify you when the internal build is available for download.

    As a token of gratitude for your involvement your Telerik points have been updated.

    Kind regards,
    Tsvetomir Tsonev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. T. Tsonev
    Admin
    T. Tsonev avatar
    2815 posts

    Posted 12 Sep 2012 Link to this post

    Hi,

    We're ready with the fix and it will be available in the upcoming Service Pack. It should be available to customers within a week or so.

    All the best,
    Tsvetomir Tsonev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top