ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  how to convert x-axis charttime into string time
Posted by slaniwani on Feb-24-2011 17:13
Attachments:
Hi,

my problem is that :

I have these textboxes :
        textbox1 = c.addText(55, 55,
            "<*block*>Slope\\nIntercept\\nCorrelation\\nStd Error<*/*>   <*block*>%.2f " \\
            "\\n%.2f \\n%.2f\\n%.2f <*/*>" % (trendlayer1.getSlope()*1000,
            trendlayer1.getIntercept(), trendlayer1.getCorrelation(), trendlayer1.getStdError()
            ), "arialbd.ttf", 8)
        textbox1.setBackground('0x78EFFE',0,1)


in that is the .getIntercept(), and if I am right, its the x value when y = 0. Well, how can i convert this unreadable Intercept : "42950960.00" into a readable time?

These are the values for the x-axis : chart_time1.append(chartTime(float(myval["x"])))

I dont know how to convert it in this textbos to a string time or something similiar.

Please help me.
slaniwani
ScreenHunter_02 Feb. 24 10.09.jpg

  Re: how to convert x-axis charttime into string time
Posted by slaniwani on Feb-24-2011 17:48
...its the other way around. -_-

Hi slaniwani,
It is the y-intercept (the value of y when x = 0).
Hope this can help.
Regards
Peter Kwan

Iam getting the solution every time I create a post in this support forum....iam very sorry. :(

Its a unix_timestamp in seconds right? So, it can be 0.

  Re: how to convert x-axis charttime into string time
Posted by Peter Kwan on Feb-24-2011 18:56
Hi slaniwani,

Yes. The intercept is the y value when x = 0. If you are using chartTime for the x-coordinates, then the x value is chartTime (clock seconds elapsed since Jan 1, 0001 00:00:00), not unix_timestamp (seconds elapsed since Jan 1, 1970 00:00:00 GMT).

If you think the intercept is not meaningful for your application (that is, your users would not be interested to know what is the y-value at Jan 1, 0001 00:00:00), you may modify the code to not displaying that value.

Hope this can help.

Regards
Peter Kwan