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

Message ListMessage List     Post MessagePost Message

  Setting the title on y axis not working
Posted by oplaza on May-26-2011 16:44
Attachments:
Hi, I am trying to show a title on the y axis but when i try to show it , it is cut by the graph.

Here you have the code:

$m = new FinanceChart($width);
$m->setPlotAreaStyle(0xFFFFFF, 0xdddddd, 0xCCCCCC, 0xCCCCCC, 0xCCCCCC);
$m->setData($timeStamps, $highData, $lowData, $openData, $closeData, $volData,
$extraPoints);

$m->addPlotAreaTitle(TopLeft, $tickerKey);

$m->setAxisOnRight(false);
$myMainChart = $m->addMainChart($mainHeight);

$myMainChart->yAxis()->setTitle("Price (p)");

Attached you have the graph.

as you can see the title is there but is cut :(

thanks in advance
financedemo.png

  Re: Setting the title on y axis not working
Posted by Peter Kwan on May-27-2011 00:10
Hi oplaza,

By default, the FinanceChart only reserves 40 pixels of margin on the left and right sides. If you need to add a title, you may need to increase the margin using FinanceChart.setMargins. For example:

$m->setMargins(70, 30, 40, 30);

Hope this can help.

Regards
Peter Kwan

  Re: Setting the title on y axis not working
Posted by oplaza on May-27-2011 00:17
AS easy as that... thank you!!!

i didnt found this function on the doc :(

thanks!

  Re: Setting the title on y axis not working
Posted by oplaza on May-27-2011 00:28
Peter,

is there any way to draw margins between indicators?

or is there any setMargins function for XYCharts?

thanks

  Re: Setting the title on y axis not working
Posted by Peter Kwan on May-27-2011 00:33
Hi oplaza,

For the documentation on FinanceChart.setMargins, you may go to the ChartDirector documention index, and look for "FinanceChart.setMargins".

To get a list of all FinanceChart methods, please to the ChartDirector documention index, and look for "FinanceChart". This will lead to a page that contains a table with all the FinanceChart methods.

For the "margins between indicators", I assume you are referring to the gap between the two indicator charts. It is configurable using FinanceChart.setPlotAreaBorder. For example:

$m->setPlotAreaBorder(0x888888, 5);

Hope this can help.

Regards
Peter Kwan

  Re: Setting the title on y axis not working
Posted by oplaza on May-27-2011 00:50
Thanks!!

now it's perfect!!!

just a last question!!

is there any way to show th xaxis labels in every graph and indicator?

actually it only shows on the last indicator added.


thanks a lot for your support

  Re: Setting the title on y axis not working
Posted by Peter Kwan on May-28-2011 00:07
Hi oplaza,

For the x-axis labels, each added indicator chart will automatically disable the x-axis label of the previous chart by setting their colors to transparent. That's why only the last added indicator chart has x-axis labels.

To show x-axis labels for all indicator charts, you may store all the indicator charts you have added, and then after you have added all the indicator charts, you may set all their x-axis label color to black.

The code is like:

#store the added chart to allCharts
$allCharts[] = $c->addMainChart();

....

#store the added chart to allCharts$allCharts[] = $c->addSlowStochastic(75, 14, 3, 0x006060, 0x606000);

#store the added chart to allCharts
$allCharts[] = $c->addMACD(75, 26, 12, 9, 0x0000ff, 0xff00ff, 0x008000);

....

#set all x-axis labels to black
foreach ($allCharts as $a) $a->xAxis->setColors(0x000000, 0x000000);

Hope this can help.

Regards
Peter Kwan

  Re: Setting the title on y axis not working
Posted by oplaza on May-30-2011 16:34
As allways it is working perfect,

thank you very much :)