cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
patriciafm811
Level II

How do I get labels to 'stack' in graph builder?

Hello. I am trying to get the labels in this map to be 'stacked' (so that it says the abbreviation on one line and then the number on the next line). Is there a way to do this? Thank you!

 

patriciafm811_0-1687445692039.png

 

5 REPLIES 5
jthi
Super User

Re: How do I get labels to 'stack' in graph builder?

I think one fairly easy option which should work is to create new column with ",\!N" as separator between different values.

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");

:name << Label(0);
new_col = dt << New Column("LABEL", Character, Nominal, Formula(
	Char(:height) ||",\!N" || Char(:weight)
));
new_col << Label(1);

gb = dt << Graph Builder(
	Size(1029, 499),
	Variables(X(:name), Y(:height)),
	Elements(Bar(X, Y, Legend(6), Label("Label by Row")))
);

jthi_0-1687446696011.png

 

-Jarmo
patriciafm811
Level II

Re: How do I get labels to 'stack' in graph builder?

So I tried this and I can't get it to work in the map. 

jthi
Super User

Re: How do I get labels to 'stack' in graph builder?

Seems to work here

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/CrimeData.jmp");

dt << New Column("LABEL", Character, Nominal, Label(1), Formula(
	:Region || ",\!N" || :State
));

:Region << Label(0);
:State << Label(0);
:Year << Label(0);

dt << Select Where(Row() != Col Min(Row(), :State)) << Hide and Exclude(1);

dt << Select Where(Row() == Col Min(Row(), :State)) << Label << Clear Select;

gb = dt << Graph Builder(
	Variables(Color(:Total Rate), Shape(:State)),
	Elements(Map Shapes())
);

Do you happen to have multiple values for each map shape?

-Jarmo
patriciafm811
Level II

Re: How do I get labels to 'stack' in graph builder?

I can't seem to get it. 

patriciafm811_0-1687453481805.png

patriciafm811_1-1687453559550.png

 

 

jthi
Super User

Re: How do I get labels to 'stack' in graph builder?

You have to use label only on the formula column. And I'm not sure if you can write row change to the column by hand (that is why I did use formula with concatenation). You can see that the "\!N" is not visible in my rows

jthi_0-1687454903899.png

(I'm using JMP17)

-Jarmo