|
Date formating in Finance Chart (2) |
Posted by William on Feb-18-2025 02:35 |
|
Hello, my previous attempt to send this may have got messed up. Browser issues....
I'm using the code in Finance Chart (2) to evaluate ChartDirector because I like the way that this example changes the timeStamps data into months. Though I don't see any formatting option that is making it do so.
using the Finance Chart 2 PHP script, I passed some data from a database that it the same format as the data in the original timeStamps data, but the timeStamps just become a blur of data. Both timestamp arrays have 130 items.
part of original timestamps from random number generator - which gets modified to months on chart
Array ( [0] => 63166694400 [1] => 63166780800 [2] => 63166867200 [3] => 63167126400 [4] => 63167212800 [5] => 63167299200 [6] => 63167385600 [7] => 63167472000 [8] => 63167731200 [9] => 63167817600 [10] => 63167904000 [11] => 63167990400 [12] => 63168076800 [13] => 63168336000 [14] => 63168422400 [15] => ....
part of timestamps from database: (which becomes a blur of data on the chart).
Array ( [0] => 63875001600 [1] => 63874915200 [2] => 63874828800 [3] => 63874742400 [4] => 63874483200 [5] => 63874396800 [6] => 63874310400 [7] => 63874224000 [8] => 63874137600 [9] => 63873878400 [10] => 63873792000 [11] => 63873705600 [12] => 63873619200 [13] => 63873532800 [14] => 63873273600 [15] => ...
Any help would be much appreciated.
Thanks,
William |
Re: Date formating in Finance Chart (2) |
Posted by Peter Kwan on Feb-18-2025 15:51 |
|
Hi William,
The timeStamps should be in chronological order. In the timestamps from database, they are are in reverse order. You can manually read the array to see that they are in reverse order.
If your data are from a database, please make sure the SQL query order the data by the timeStamp.
Best Regards
Peter Kwan |
Re: Date formating in Finance Chart (2) |
Posted by william on Feb-22-2025 01:51 |
|
Hi Peter,
You are right! Thank you! I changed the date order from the database to be Ascending and it works fine now. :-)
Kind regards,
William |
|