|
LogScale - powers of 10 (like 10?) |
Posted by mephy on Oct-13-2014 01:30 |
|
Hello!
Is there any way I can set log scale axis to use powers like 10??
I've tried to use $c->yAxis->addLabel(500, "10?");
but I get "10?" no chart
Thank you. |
Re: LogScale - powers of 10 (like 10?) |
Posted by mephy on Oct-13-2014 01:36 |
|
Oh, sorry - "10?" issue was solved by right codepage.
But maybe there is more elegant way? |
Re: LogScale - powers of 10 (like 10?) |
Posted by mephy on Oct-13-2014 02:14 |
|
And how I can hide default labels?
$c->yAxis->setLogScale(0, 10000, noValue, 0);
doesnt work |
Re: LogScale - powers of 10 (like 10?) |
Posted by Peter Kwan on Oct-14-2014 01:12 |
|
Hi mephy,
To hide the default labels, use setLogScale2 with an empty array. It s like:
$c->yAxis->setLogScale2(1, 10000, array());
Note that setLogScale(0, 10000, ...) is invalid, because a log scale cannot contain 0.
10^0 is equal to 1.
For your case, you do not even need to hide the labels in setLogScale2. You can provide
the labels to be used directly. It is like:
$labels = array("10<*super*>0", "10<*super*>1", "10<*super*>2", "10<*super*>3",
"10<*super*>4");
$c->yAxis->setLogScale2(1, 10000, $labels);
The 10<*super*>0 means 10 followed by a superscript character 0. Although some fonts
has special characters for the superscript 2 and 3, it does not have superscript for other
characters, and to access those special characters, you need to use the correct font
encoding. Using the ChartDirector <*super*> tag allows you use superscript any
standard characters, and no special encoding is needed if the superscript characters are
numbers.
The sample code "Icon Pie Chart (2)" is an example that includes using superscript (note
the chart title).
Hope this can help.
Regards
Peter Kwan |
|