cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar

Pareto Graph - changing cumulative percent formatting label

Does anyone know if it is possible to change the formatting of the cumulative % label in the pareto plot?

 

wendytseng_0-1591129868678.png

This was made using the Failure.jmp sample data table and Analyze --> Quality and Process --> Pareto Plot as shown below

wendytseng_1-1591129931504.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
gzmorgan0
Super User (Alumni)

Re: Pareto Graph - changing cumulative percent formatting label

@wendytseng ,

 

Does your request refer to text fonts or to data formatting or both?  You can create a Pareto Plot with GraphBuilder. It requires that you create a cumulative sum column, but in return you can customize both font and data format and even more with Hover Labels if you want even more features.

 

The script below (and attached) hopefully is self explanatory. it creates two plots.  Note they are journaled, since to create the cumulative sum column, the table needs to be sorted and the Quality and Process Pareto plot needs to be closed to do so.

Note the Font of the cumulative labels, is Text Font() for the Pareto report and Graph Label() for Graph Builder report.

 

image.pngimage.png

 

Names Default to Here(1);

dt = Open("$Sample_Data/Quality Control/Failure.jmp");

//get default Text Font
txtpref = Get Preferences(Text Font);

//set preferred font
Set Preference(Text Font("Segoe UI", 10, "Bold"));
wait(0);

//draw graph
pplot = dt << Pareto Plot( Cause( :failure ), Freq( :N ), Label Cum Percent Points( 1 ) );

pplot << Journal ;
wait(0);
pplot<<Close Window();

//reset text font
wait(0);
txtpref;

//do this with GraphBuilder
 //new column to be used with GraphBuilder solution
//first Sort Table

dt << Sort( By( :N ), Order( Descending ), Replace Table );


//create a column of cum percent with preferred data format 
pct = dt << New Column("Cumulative Percent", Numeric, "Continuous",	Format( "Percent", 10, 1 ),
 Formula(Col Cumulative Sum( :N ) / Col Sum( :N )));
 
dt << Set Label Columns( :Cumulative Percent );
dt << Select all rows();
dt << Label(1);
dt << clear select;

 //change font if preferred for Graph Builder this is Graph Label
 glabelpref = Get Preferences(Graph Label);
 Set Preference(Graph Label("Segoe UI", 10, "Bold"));
 wait(0);
 
gb_pplot = dt << Graph Builder(
	Size( 534, 475 ),
	Show Control Panel( 0 ),
	Variables(
		X( :failure, Order By( :N, Descending, Order Statistic( "Mean" ) ) ),
		Y( :N ),
		Y( :Cumulative Percent, Position( 1 ), Side( "Right" ) )
	),
	Elements(
		Bar( X, Y( 1 ), Legend( 14 ), Label( "Label by Value" ) ),
		Points( X, Y( 2 ), Legend( 12 ) ),
		Line( X, Y( 2 ), Legend( 13 ) )
	)
);

gb_pplot << Journal;
gb_pplot << Close Window();


View solution in original post

1 REPLY 1
gzmorgan0
Super User (Alumni)

Re: Pareto Graph - changing cumulative percent formatting label

@wendytseng ,

 

Does your request refer to text fonts or to data formatting or both?  You can create a Pareto Plot with GraphBuilder. It requires that you create a cumulative sum column, but in return you can customize both font and data format and even more with Hover Labels if you want even more features.

 

The script below (and attached) hopefully is self explanatory. it creates two plots.  Note they are journaled, since to create the cumulative sum column, the table needs to be sorted and the Quality and Process Pareto plot needs to be closed to do so.

Note the Font of the cumulative labels, is Text Font() for the Pareto report and Graph Label() for Graph Builder report.

 

image.pngimage.png

 

Names Default to Here(1);

dt = Open("$Sample_Data/Quality Control/Failure.jmp");

//get default Text Font
txtpref = Get Preferences(Text Font);

//set preferred font
Set Preference(Text Font("Segoe UI", 10, "Bold"));
wait(0);

//draw graph
pplot = dt << Pareto Plot( Cause( :failure ), Freq( :N ), Label Cum Percent Points( 1 ) );

pplot << Journal ;
wait(0);
pplot<<Close Window();

//reset text font
wait(0);
txtpref;

//do this with GraphBuilder
 //new column to be used with GraphBuilder solution
//first Sort Table

dt << Sort( By( :N ), Order( Descending ), Replace Table );


//create a column of cum percent with preferred data format 
pct = dt << New Column("Cumulative Percent", Numeric, "Continuous",	Format( "Percent", 10, 1 ),
 Formula(Col Cumulative Sum( :N ) / Col Sum( :N )));
 
dt << Set Label Columns( :Cumulative Percent );
dt << Select all rows();
dt << Label(1);
dt << clear select;

 //change font if preferred for Graph Builder this is Graph Label
 glabelpref = Get Preferences(Graph Label);
 Set Preference(Graph Label("Segoe UI", 10, "Bold"));
 wait(0);
 
gb_pplot = dt << Graph Builder(
	Size( 534, 475 ),
	Show Control Panel( 0 ),
	Variables(
		X( :failure, Order By( :N, Descending, Order Statistic( "Mean" ) ) ),
		Y( :N ),
		Y( :Cumulative Percent, Position( 1 ), Side( "Right" ) )
	),
	Elements(
		Bar( X, Y( 1 ), Legend( 14 ), Label( "Label by Value" ) ),
		Points( X, Y( 2 ), Legend( 12 ) ),
		Line( X, Y( 2 ), Legend( 13 ) )
	)
);

gb_pplot << Journal;
gb_pplot << Close Window();