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

Message ListMessage List     Post MessagePost Message

  How can i change fontcolor in legend
Posted by mona on Feb-03-2009 21:33
I wan't to change the color of font  in legend but i don't know how to change the color of font i am using the trial version of chart director and i wan't to edit finance.php file

<?php
require_once("../lib/FinanceChart.php");

$noOfDays = 100;
$extraDays = 30;

$rantable = new RanTable(9, 6, $noOfDays + $extraDays);

$rantable->setDateCol(0, chartTime(2007, 9, 4), 86400, true);

$rantable->setHLOCCols(1, 100, -5, 5);

$rantable->setCol(5, 50000000, 250000000);

$timeStamps = $rantable->getCol(0);
$highData = $rantable->getCol(1);
$lowData = $rantable->getCol(2);
$openData = $rantable->getCol(3);
$closeData = $rantable->getCol(4);
$volData = $rantable->getCol(5);

$c = new FinanceChart(1000);

$c->setData($timeStamps, $highData, $lowData, $openData, $closeData, $volData,
    $extraDays);

$c->addMainChart(210);

$c->addSimpleMovingAvg(9, 0xFFFF33);

$c->addSimpleMovingAvg(14, 0xED3F25);

$c->addHLOC(0x008000, 0x008000);

$c->addRSI(70, 14, 0x800080, 20, 0xFF3333, 0x66FFFF);
$c->addSlowStochastic(50,14, 3, 0x006060, 0x606000);
$c->addFastStochastic(50, 14, 3, 0x66FFFF, 0xED4632);
# output the chart
header("Content-type: image/png");
print($c->makeChart2(PNG));
?>

  Re: How can i change fontcolor in legend
Posted by Peter Kwan on Feb-04-2009 01:22
Hi mona,

You may use FinanceChart.setLegendStyle. For example:

$c->setLegendStyle("arial.ttf", 8, 0xcc0000);

You may refer to the ChartDirector documentation on "FinanceChart.setLegendStyle" for details of this method.

Hope this can help.

Regards
Peter Kwan