开发者

javascript date query

开发者 https://www.devze.com 2022-12-24 10:40 出处:网络
i\'m try to point so dots on a graph and label them with a date... its working but having problems converting date string. the script i\'m using is below.x is the time stamp but when used i get NaN va

i'm try to point so dots on a graph and label them with a date... its working but having problems converting date string. the script i'm using is below. x is the time stamp but when used i get NaN values when replaced with 1268956800000 for example it works fine.

i can see where i'm going wrong i think x is not a value when called? but javascript is not a strong point please help

      if (item) {
            if (previousPoint != item.datapoint) {
                previousPoint = item.datapoint;

                $("#tooltip").remove();
                var x = item.datapoint[0].toFixed(0),
                    y =开发者_JAVA百科 item.datapoint[1].toFixed(0);

                 d = new Date(x);
                 curr_date = d.getDate();
                 curr_month = d.getMonth();
                 curr_year = d.getFullYear();   

                showTooltip(item.pageX, item.pageY,
                            item.series.label + " qty " + y + curr_date + " / " + curr_month + " / " + curr_year);
            }

    }


var x = parseInt(item.datapoint[0].toFixed(0));
0

精彩评论

暂无评论...
验证码 换一张
取 消