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

Message ListMessage List     Post MessagePost Message

  vertical xaxis text
Posted by Ross Larter on Mar-02-2007 01:25
Attachments:
Hi,

I am setting my xaxis labels like below:

my $textbox = $c->xAxis()->setLabels($labels);
$textbox->setFontStyle("LTYPEB.ttf");
$textbox->setFontSize(6);

But i need to rotate them 90 degrees so they fit on the graph without overwritting each other, is this possible.

Thanks
Ross
test.png

  Re: vertical xaxis text
Posted by Ross Larter on Mar-02-2007 01:26
Also, is it possible to make the bars below the line a different color to the ones above the postive axis.

Cheers
Ross

  Re: vertical xaxis text
Posted by Peter Kwan on Mar-02-2007 03:26
Hi Ross,

To rotate the labels by 90 degrees, you may use:

$textbox->setFontAngle(90);

To make negative bars a different color, you may split the bars into 2 data sets, so they may have different colors. For an example, see "ChartDirector Documentation/XY Charts/Bar Charts/Positive Negative Bars".

Hope this can help.

Regards
Peter Kwan

  Re: vertical xaxis text
Posted by Bob Eagan on Mar-02-2007 04:36
I am having trouble translating this into my php code.

I have the following to create my x-axis labels (which are an array of values):

# Set x axis labels using the given labels
$c->xAxis->setLabels($labels);


I have tried different approaches with no luck including:

$c->xAxis->setLabels($labels)->setFontAngle(90); //does nothing

and

$c->xAxis->setFontAngle(90); // throws an error - Call to undefined method Axis::setFontAngle()


Any help is greatly appreciated.

  Re: vertical xaxis text
Posted by Peter Kwan on Mar-02-2007 14:00
Hi Bob,

The PHP syntax does not allow dereferencing a returned value from a function call (though this is allowed most other programming lanauges). You need to store the return value in a variable and dereference the variable. For example:

#This is illegal syntax in PHP
#$c->xAxis->setLabels($labels)->setFontAngle(90);

#This is legal syntax in PHP
$temp = $c->xAxis->setLabels($labels);
$temp->setFontAngle(90);

Hope this can help.

Regards
Peter Kwan

  Re: vertical xaxis text
Posted by seafree on Jun-19-2014 23:07
Hola yo tengo el mismo problema pero con PERL, me pueden apoyar por favor.

  Re: vertical xaxis text
Posted by seafree on Jun-19-2014 23:10
Hola yo tengo el mismo problema pero con PERL, PIERDO LA IMAGEN DE LA GRAFICA.

# Configure the bars within a group to touch each others (no gap)
$layer->setBarGap(0.2, $perlchartdir::TouchBar);

$ver= $c->xAxis->setLabels($labels);
$ver->setFontAngle(90);

# output the chart

my $chart1URL = $ver->makeTmpFile("/tmp/tmpcharts");
my $imageMap = $ver ->getHTMLImageMap("","","title='{dataSetName}@{xLabel}:{value|0}'");


Les agradecere enormemente su apoyo gracias.

  Re: vertical xaxis text
Posted by Peter Kwan on Jun-19-2014 23:23
Hi seafree,

The code in Perl should be:

$c->xAxis()->setLabels($labels)->setFontAngle(90);

You can also use:

my $ver= $c->xAxis()->setLabels($labels);
$ver->setFontAngle(90);

Hope this can help.

Regards
Peter Kwan

  Re: vertical xaxis text
Posted by seafree on Jun-20-2014 00:10
I used your tips but I run the Perl debugger:

"UNKNOW METHOD TextBox.xAxis"

What is happen?

  Re: vertical xaxis text
Posted by seafree on Jun-19-2014 23:33
I need show the textlabel in vertical form, I use setFontAngle but lose the chart image, how do'it in PERL, can you help me? please:

my $labels = ["Mon", "Tue", "Wed", "Thur", "Fri"];
# Set the x axis labels
$c->xAxis()->setLabels($labels);

I USED:
$c->xAxis()->setLabels($labels)->TextBox.setFontAngle(90);

BUT I don't show nothing. What can I do?, thanks.

  Re: vertical xaxis text
Posted by Peter Kwan on Jun-20-2014 00:05
Hi seafree,

It should be :

$c->xAxis()->setLabels($labels)->setFontAngle(90);

Hope this can help.

Regards
Peter Kwan

  Re: vertical xaxis text
Posted by seafree on Jun-20-2014 00:19
I did but the chart not changed, the text continue in horizontal form.

  Re: vertical xaxis text
Posted by Peter Kwan on Jun-20-2014 02:02
Hi seafree,

Is it possible that you have another line of code that changes the font angle back to 0 (eg.
a line that calls Axis.setLabelStyle)? Is it possible to inform me the complete charting part
of your code?

Regards
Peter Kwan

  Re: vertical xaxis text
Posted by seafree on Jun-20-2014 03:38
Thats ok, thank you.