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

Message ListMessage List     Post MessagePost Message

  set colors in chart
Posted by coolGuy on Aug-31-2011 19:10
Hi every one

I have a problem and I hope you'll be helpfull. I'm using chartDirector for a php project.  I wanna get colors from my database and set them in $colors chart variable. But  i can't. The colors that i want to set are saved on database on string format and not hex format so all I see in the chart are black (Exp "0xFF009A" is considered 0x000000).

I don't know what to do.

Regards

  Re: set colors in chart
Posted by Peter Kwan on Sep-01-2011 03:44
Hi coolGuy,

You may refer to the documentation of your prorgramming language on how to convert a text string to a number.

For example, if you are using PHP, according to PHP syntax rules, the "0xFF009A" should be coerced to 0 in numeric context. If you want to interpret the text string as a hex number, there is a PHP function hexdec that does that, like:

$myColor = hexdec($myColorInString);

For more details, please refer to PHP documentation:

http://php.net/manual/en/function.hexdec.php

Hope this can help.

Regards
Peter Kwan