Page 1 of 1

Recovering start point and end point of a line graph

Posted: Mon Sep 10, 2012 12:17 pm
by 17763433
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.

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

Posted: Mon Sep 10, 2012 5:16 pm
by 16461616
The number is a JavaScript Date value defined as "milliseconds since 1970/01/01"

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

Posted: Tue Sep 11, 2012 2:53 pm
by 17763433
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.