Recovering start point and end point of a line graph

TeeChart for JavaScript for the HTML5 Canvas
Post Reply
Osvano
Newbie
Newbie
Posts: 8
Joined: Fri Sep 07, 2012 12:00 am

Recovering start point and end point of a line graph

Post by Osvano » Mon Sep 10, 2012 12:17 pm

Dear friends,
I have a line chart, and need to retrieve the start point and end point even after the zoom:

I'm using axis.bootom as:

Chart1.axes.bottom.labels.dateFormat = "isoTime";

I tried using the onzoom

Chart1.onzoom = function () {
     alert (Chart1.axes.bottom.minimum);
     alert (Chart1.axes.bottom.maximum);
};

But the return is a very large number, someone can tell me what is the format of that number? And how can I convert it in seconds, for example?

Sincerely,

Osvano.

RJCookeSE
Newbie
Newbie
Posts: 8
Joined: Fri Feb 17, 2012 12:00 am
Contact:

Re: Recovering start point and end point of a line graph

Post by RJCookeSE » Mon Sep 10, 2012 5:16 pm

The number is a JavaScript Date value defined as "milliseconds since 1970/01/01"

Osvano
Newbie
Newbie
Posts: 8
Joined: Fri Sep 07, 2012 12:00 am

Re: Recovering start point and end point of a line graph

Post by Osvano » Tue Sep 11, 2012 2:53 pm

Thanks RJCookeSE

I managed to solve this:

1) I created my start date to:

Code: Select all

var now = new Date (1970, 0, 1, 0, 0, 0, 0). getTime ();
2) And to make the zoom:

Code: Select all

Chart1.onzoom = function () {
     document.getElementById('frmDatas:idInicio').Chart1.axes.bottom.minimum.toFixed(0) / 1000;
     document.getElementById('frmDatas:idFinal').Chart1.axes.bottom.maximum.toFixed(0) / 1000;
};
Thank you,

Sincerely,

Osvano.

Post Reply