0

I am trying to visualize some data using cubism every 10 mins.

I am facing problems while cubism displays data. The metric definition is all fine as i saw while debugging but it visualizes data at the wrong time.

Here is where the push into values happen -

while((i += step) < stop) {
var key = (new Date(i)).getTime();
    for(var j=0; j<rec24.length; j++){
        if((rec24[j].receiveddate <= key) && (rec24[j].receiveddate > (key - 600000))){
            var value = rec24[j].gtse;
                values.push(value);
        }
        else{
            values.push(null);
        }
    }
}
callback(null, values = values.slice((start - stop) / step));

Here is how it looks now. Kinda strange since it renders for Fri 28 8:10AM, Fri 28 9:40PM, Sat 29 11:10AM and so on. Here is how it looks now image link

Am i missing something here ?

Dan
  • 801
  • 2
  • 14
  • 29
  • What do you want it to display? – Lars Kotthoff Jul 05 '13 at 15:10
  • i want to render the value of gtse in the proper time interval i.e i am getting the time from db and matching it with the interval in the visualization and want to display the value of gtse in that slot of 10 min pixel (step is 10 mins) for the specific time – Dan Jul 06 '13 at 10:25
  • time comparison here is in millis – Dan Jul 06 '13 at 10:53

1 Answers1

1

silly mistake. was pushing null for every step.

while((i += step) < stop) {
    var key = (new Date(i)).getTime();
    var pushFlag = new Boolean();
pushFlag = false;
    for(var j=0; j<rec24.length; j++){
        if((rec24[j].receiveddate <= key) && (rec24[j].receiveddate > (key - 600000))){
            var value = rec24[j].gtse;
            values.push(value);
            pushFlag = true;
        }
    }
    if(!pushFlag){
        values.push(null);
    }
}
callback(null, values = values.slice((start - stop) / step));
Dan
  • 801
  • 2
  • 14
  • 29