This is a migrated thread and some comments may be shown as answers.

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

2 Answers 38 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Adrian
Top achievements
Rank 1
Adrian asked on 04 Sep 2012, 11:27 AM
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 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 05 Sep 2012, 02:28 PM
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!
0
T. Tsonev
Telerik team
answered on 12 Sep 2012, 11:27 AM
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!
Tags
Charts
Asked by
Adrian
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Share this question
or