let lst_val ;
let off_set = 0;
function genTicks(value, index, ticks)
{
if (index == 0)
{
lst_val = ticks[0].value;
off_set = (ticks[ticks.length - 1].value - ticks[0].value) / ticks.length;
let gh = new Date(ticks[0].value);
return gh.getDate() + " " + gh.getHours()+ ":" + gh.getMinutes()+ ":" + gh.getSeconds();
}
lst_val = lst_val + off_set;
let gh = new Date((lst_val + (off_set*index)));
console.log("tt: ",lst_val);
return gh.getDate() + " " +gh.getHours()+ ":" + gh.getMinutes()+ ":" + gh.getSeconds();
}
output looks like thi
tt: Sat Jan 01 2022 00:00:00 GMT+0500 (Pakistan Standard Time)9967333.3333333349967333.3333333349967333.3333333349967333.3333333349967333.3333333349967333.3333333349967333.3333333349967333.333333334
I am trying to add two numbers. but is treating them as a number. Any fix for this.
Thanks in Advance.