> Hi people,
> Trying to make a simple linegraph.
> graph works fine if i give 2 ints but when i use a date and and int it does
> not work. 
> SQL ERROR: 'DATE' is not a recognized data type! 
> 
> 1)i looked up the datatype in a mysql table and "date" is obviously
> supported
> 2)how do i get this to work .date in mysql format on x axis and polled value
> on y
>         use DBIx::Chart;
>         use DBI qw(:sql_types);
>         #
>         #       some data to plot
>         #
>         my @data = (
>         [ "2004-03-07", 102 ],
>         ["2004-03-08",  222 ],
>         [ "2004-03-09", 67 ]
>         );
> 
> 
>   $dbh = DBIx::Chart->connect('dbi:CSV:');
>         #
>         #       populate the CSV
>         #
>         $dbh->do('DROP TABLE dbixtst');
>         $dbh->do('CREATE TABLE dbixtst (
>                 x date, y1 integer)')
>                 or die $dbh->errstr();
> 
>         $sth = $dbh->prepare('insert into dbixtst values(?,?)');
>         $sth->execute(@{$_})
>                 foreach (@data);
>         #
>         #       now render the graph
>         #
>         $row = $dbh->selectrow_arrayref(
>         "select * from dbixtst
>         returning linegraph(x,y1)
>         where colors in ('orange', 'yellow','red')
>         and linewidth=3
>         and shapes in ('fillsquare', 'opencircle')
>         ");
>         #
>         #       and save it
>         #
>         open(OUTF, '>comparea.png');
>         binmode OUTF;
>         print OUTF $$row[0];
>         close OUTF;
> 
>         $dbh->disconnect;
> 
> Thanks.
> Regards,
> chimni
> 

Are you using the dbi:CSV connection as listed above ? I don't think CSV has a
DATE type...

Dean Arnold
Presicient Corp.
www.presicient.com

Reply via email to