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

Message ListMessage List     Post MessagePost Message

  defining the colors for lines
Posted by Subhash Goel on Dec-09-2008 03:56
I am trying to define my color for the line but getting error message as

$lineLayerObj = $chart->addLineLayer($ydata, -1, $legend);
$lineobj = $lineLayerObj->getLine();
$color = "0xFFFF00";
$lineobj->setColor($color);


I am getting following error message

Fatal error: Call to a member function setColor() on a non-object in C:\\xampp\\htdocs\\Sprint-IQ\\ProcData.php on line 462

The purpose is to define my own dark colors for the line and the symbols.

Thanks,

Subhash

  Re: defining the colors for lines
Posted by Peter Kwan on Dec-09-2008 13:48
Hi Subhash,

According to the ChartDirector documentation, the getLine object only returns an "opaque" object. This means the object are not usable by the user code. The only thing one may do with the object is to pass it to XYChart.addInterLineLayer.
So the return value of getLine should be treated like a "handle" but not as a real object.

In your case, note that there is another issue. The color should be 0xFFFF00 (without quotes), not "0xFFFF00".

To set the color of a line, use:

$color = 0xFFFF00;
$lineLayerObj = $chart->addLineLayer($ydata, $color, $legend);

Hope this can help.

Regards
Peter Kwan