Jfreechart, symbolAxis and state encode

E

etantonio

Good Evening for a chart concerning four three state I want to use
JFreeChart and symbolAxis,
my problem is that I've the following code values :

1 RX comando

2 PLL agganciato

3 PLL sganciato


while using symbolAxis it automatically give the following encode :

0 RX comando

1 PLL agganciato

2 PLL sganciato


my question is how to have an arbitrary code associated with the
labels ?
There's a way ??

Thanks,

Antonio
www.etantonio.it/en
 
J

John B. Matthews

etantonio said:
Good Evening for a chart concerning four three state I want to use
JFreeChart and symbolAxis, my problem is that I've the following code
values :

1 RX comando
2 PLL agganciato
3 PLL sganciato


while using symbolAxis it automatically give the following encode :

0 RX comando
1 PLL agganciato
2 PLL sganciato

my question is how to have an arbitrary code associated with the
labels ? There's a way ??

The SymbolAxis constructor takes an array of String values, which can
include any characters you want:

<http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/axis/SymbolA
xis.html>

I don't see how SymbolAxis would alter your choices. Perhaps an
<http://pscode.org/sscce.html> would help.
 
E

etantonio

the array of String values for me contains "RX comando" , "PLL
agganciato", "PLL sganciato"
from my engine arrive to this chart just the values 1,2,3 so I
couldn't pass it directly to the chart,
that would be nice if I could give to SymbolAxis a similar array that
tells the value associated with the corresponding label.

Antonio
www.etantonio.it
 
J

John B. Matthews

I wrote:

the array of String values for me contains "RX comando" , "PLL
agganciato", "PLL sganciato" from my engine arrive to this chart just
the values 1,2,3 so I couldn't pass it directly to the chart, that
would be nice if I could give to SymbolAxis a similar array that
tells the value associated with the corresponding label.

I guess you could set the symbol for value zero to the empty string and
negate setAutoRangeIncludesZero. Tinkering with setAxisOffset might be
helpful, too. Also, try searching the demos for "SymbolAxis".

Of course, without seeing your <http://pscode.org/sscce.html>,
I'm guessing.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top