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

Message ListMessage List     Post MessagePost Message

  How to make the xAxis labels start from a position righter than at (0,0)?
Posted by Shahar on Apr-23-2010 14:54
Hi
I'm using PHP chardirector version 5.
and i need to display the Symbol Line Chart (2) graph(in the examples)
my question is How to make the xAxis labels start from a position righter than at (0,0)?
for example the labels at the bottom are (label1,label2...label5),and label1 appears on 0,0 of the graph i want it to appear on point 5,0 on the graph.

Thanks in Advance,Shahar

  Re: How to make the xAxis labels start from a position righter than at (0,0)?
Posted by Peter Kwan on Apr-23-2010 17:13
Hi Shahar,

I am not sure where is "point 5,0" mean, or exactly how you want to display the chart.

If you want to shift the labels, you may use Axis.setLabelOffset. For example:

#Shift the label by 0.5 units to the right, so the labels are in between the ticks
$c->xAxis->setLabelOffset(0.5);

Note that if you do the above, the rightmost label will be shifted outside the chart and so will disappear. Also, the labels will no longer match the data points.

If what you actually want is to shift the ticks (put the ticks between the labels), and expand the chart a little bit, the code is:

$c->xAxis->setTickOffset(0.5);
$c->xAxis->setIndent(true);

Hope this can help.

Regards
Peter Kwan

  Re: How to make the xAxis labels start from a position righter than at (0,0)?
Posted by Shahar on Apr-23-2010 17:59
Hi Peter
Thanks for your answer.
I shift the ticks with code you specify and it is looking as i wanted now.