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

Message ListMessage List     Post MessagePost Message

  Not getting the chart image correctly
Posted by Pankaj Arya on Nov-20-2010 19:13
Attachments:
Hi Peter,

After having the database connectivity in financedemochart.php i am getting multiple candles over each other. Please have a look at the attached Pics. See Charts.jpg

And also timestamp value is coming same (62135616600 )for all the symbols in the database. Thats why the chart is showing only the 1 jan 1970 as a timestamp graph.
Now i need a help for entering the correct value for the timestamp in the database. In database the timestamp values  are like 29-MAR-2010 and unable to change it into the Unix timestamp.Please see database.jpg for the same

The code we have written is

$db = mysql_connect($server,$username,$password) or DIE("Connection to database failed, perhaps the service is down !!");
$db1=mysql_select_db($db_name) or DIE("Database name not available !!");

$login = mysql_query("Select UNIX_TimeStamp(TIMESTAMP), OPEN, HIGH, LOW,  CLOSE, TOTTRDQTY From interactive WHERE SYMBOL='$ticker' ORDER by TIMESTAMP");


while ($row = mysql_fetch_array($login, MYSQL_ASSOC))
{

$timeStamps[] = chartTime2($row[TIMESTAMP]);
$openData[] = $row[OPEN];
$highData[] = $row[HIGH];
$lowData[] = $row[LOW];
$closeData[] = $row[CLOSE];
$volData[] = $row[TOTTRDQTY];
}


Thanks for the help.
Charts.jpg
database.jpg

  Re: Not getting the chart image correctly
Posted by Peter Kwan on Nov-23-2010 00:37
Hi Pankaj,

Would you mind to clarify if TIMESTAMP is really a date/time?

Note that by date/time, I mean date/time as according to the database schema. Date/time expressed in English, French, Japanese or any human language may not be a date/time to the database. If you do not use date/time at all for the TIMESTAMP, then your code may not work.

Would you mind to clarify what is your database schema?

Regards
Peter Kwan

  Re: Not getting the chart image correctly
Posted by Pankaj Arya on Nov-23-2010 01:07
Attachments:
My TIMESTAMP Schema was Varchar 40 which is wrong

in my input file the data is in format of
ABB,EQ,756.2,770.85,756.2,767.1,769.55,756.3,292376,223660807.4,31-DEC-2009,

can you please help me what should be the  correct schema of TIMESTAMP

as when i am entering the Type of TIMESTAMP as Date
i am getting error .
please see the Attachment .
Time_stamp_format.jpg

  Re: Not getting the chart image correctly
Posted by Peter Kwan on Nov-23-2010 13:00
Hi Pankaj,

For purely database issues, you may consider to post your enquiry to forums that support your database for help. There may be more experts there who can help you.

If I were you, I would create a new column as DATE, then write an SQL or script to populate the column by converting your existing text string TIMESTAMP to a date the new column.

Regards
Peter Kwan