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
Yass
Level IV

Graph display issue

Hello everyone,

 

I’m having an issue with my graph display. I selected the line option, but the first column appears as a line while the second shows points, and there’s also an enumeration appearing. Please see the attached image for clarification.

 

Yass_0-1723449912059.png

 

 

// Créer un graphique de ligne pour "Percent NOK ICT" et "Percent NOK FCT"
graph1 = Graph Builder(
    Size( 600, 400 ),
    Show Control Panel( 0 ),
    Variables( X( :Date ), Y( :Percent NOK ICT ), Y( :Percent NOK FCT ) ),
    Elements( Line( X, Y( 1 ), Legend( "Percent NOK ICT" ), Color( "Blue" ) ), 
              Line( X, Y( 2 ), Legend( "Percent NOK FCT" ), Color( "Orange" ) ) ) // Utiliser une courbe pour "Percent NOK FCT"
);

// Afficher le graphique
graph1 << Show Window;

// Créer un graphique en barres pour "Total ICT" et "Total FCT"
graph2 = Graph Builder(
    Size( 600, 400 ),
    Show Control Panel( 0 ),
    Variables( X( :Date ), Y( :Total ICT ), Y( :Total FCT ) ),
    Elements( Bar( X, Y( 1 ), Legend( "Total ICT" ), Color( "Blue" ) ), 
              Bar( X, Y( 2 ), Legend( "Total FCT" ), Color( "Orange" ) ) )
);

// Afficher le graphique
graph2 << Show Window;

// Créer un graphique de dispersion pour "Percent NOK ICT" vs. "Percent NOK FCT"
graph3 = Graph Builder(
    Size( 600, 400 ),
    Show Control Panel( 0 ),
    Variables( X( :Percent NOK ICT ), Y( :Percent NOK FCT ) ),
    Elements( Points( X, Y, Legend( "Scatter Plot" ), Color( "Green" ) ) )
);

// Afficher le graphique
graph3 << Show Window;

 

 

Thank you in advance,

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Graph display issue

You need to have a separate Elements paragraph for each of the Y variables specified.  Below is an example of the method your code uses which replicates your results, followed by an example using the correct syntax to get what you want.

Names Default To Here( 1 );
dt = 
// Open Data Table: Big Class.jmp
// → Data Table( "Big Class" )
Open( "$SAMPLE_DATA/Big Class.jmp" );

Graph Builder(
	Variables( X( :age ), Y( :height ), Y( :weight ) ),
	Elements(
		Line( X, Y(1) ),
		Line( X, Y(2) )
	)
);

Graph Builder(
	Variables( X( :age ), Y( :height ), Y( :weight ) ),
	Elements(
		Position( 1, 1 ),
		Line( X, Y, Legend( 11 ) )
	),
	Elements(
		Position( 1, 2 ),
		Line( X, Y, Legend( 12 ) )
	)
);

txnelson_0-1723454757791.png

 

Jim

View solution in original post

4 REPLIES 4
txnelson
Super User

Re: Graph display issue

You need to have a separate Elements paragraph for each of the Y variables specified.  Below is an example of the method your code uses which replicates your results, followed by an example using the correct syntax to get what you want.

Names Default To Here( 1 );
dt = 
// Open Data Table: Big Class.jmp
// → Data Table( "Big Class" )
Open( "$SAMPLE_DATA/Big Class.jmp" );

Graph Builder(
	Variables( X( :age ), Y( :height ), Y( :weight ) ),
	Elements(
		Line( X, Y(1) ),
		Line( X, Y(2) )
	)
);

Graph Builder(
	Variables( X( :age ), Y( :height ), Y( :weight ) ),
	Elements(
		Position( 1, 1 ),
		Line( X, Y, Legend( 11 ) )
	),
	Elements(
		Position( 1, 2 ),
		Line( X, Y, Legend( 12 ) )
	)
);

txnelson_0-1723454757791.png

 

Jim
Yass
Level IV

Re: Graph display issue

Thank you ! 

Yass
Level IV

Re: Graph display issue

I have a question please. Can you help me figure out how to change the bar color ?
In the screen, each parameter shows a color, but the graph displays 2 bars in blue, and the 2 last one being red.

Yass_2-1723464826153.png

 

 

txnelson
Super User

Re: Graph display issue

Right click on the bar color in the legend, and select "Fill Color", then click on the color you want.

 

I strongly suggest that you take the time to go to the Help pull down menu and select JMP Help.  Then in the search line, type in Graph Builder.  There are several links from there for topics that will show you the ins and outs of Graph Builder.

Jim