BookmarkSubscribe
Choose Language Hide Translation Bar
Yu
Yu
Community Trekker

when i use graph builder to plot Bar chart, how do I display a decimal?

Hello everyone,

thank you very much for your time.

when i use graph builder to plot Bar chart, i want to show the data mean value.

but if i select"label by value", numbers are integers. How do I display a decimal?

thank you very much.

bar.PNG

0 Kudos
1 ACCEPTED SOLUTION

Accepted Solutions
gzmorgan0
Super User

Re: when i use graph builder to plot Bar chart, how do I display a decimal?

Hmmm, I am wondering which version of JMP you are using the bar heights  and the labels do not seem to match the left, Y, Axis.

 

I do not know of a point and click method to specify a format for the Bar or Boxplot labels. If your version allows you to Add > Caption, You can create a graph like the one displayed below without scripting.  Captions seem to show smarter formatting, than labels. If the format of the Y variable (weight for the example below) is Fixed with 0 decimals, the caption mean will be reported with 1 decimal. If the format of Y was Fixed with 2 decimals then the caption mean would have 3 decimals. If the format is best then each group has different formats, based upon "Best." 

 

The steps to create this and the script can be found below.  With JSL you can create a script to add a custom label to each bar, but to keep it current with exclusions, the scripting becomes more advanced.

 

image.png

Steps:

  1. Drag Y variable to the Y axis.
  2. Right click in the graph and select Points and Change to Bar
  3. Right click in the graph and select Add Caption
  4. Right click in the graph and select Customize. The click on Text then click on the Font button and select Bold.
  5. Drag the nominal varaible to the X group area at the top. For this example, drag column age.  Note all the bars have bolded Means.
  6. Right click on the X Group Area and select X Group Edge, select Bottom

Note that the format for column weight was Fixed  width=5 and decimals=0, so the mean has exactly 1 decimal point in the caption.

Names default to here(1);

dt = Open("$sample_data/big class.jmp");


gb = dt << Graph Builder(
	Size( 534, 454 ),
	Show Control Panel( 0 ),
	X Group Edge( "Bottom" ),
	Variables( Y( :weight ), Group X( :age ) ),
	Elements( Bar( Y, Legend( 1 ) ), Caption Box( Y, Legend( 2 ) ) )
);

tseg = gb << Xpath("//FrameBox//TextSeg");
tseg <<  {Font( "Segoe UI", 8, "Bold" )};

Attached is a script that demonstrates customizing boxplots. It does not have the added code to manage exclusions ( it requires a row state handler). It demonstrates some of the steps required to figure out placement and formatting of custom labels.

 

 

0 Kudos
2 REPLIES 2
gzmorgan0
Super User

Re: when i use graph builder to plot Bar chart, how do I display a decimal?

Hmmm, I am wondering which version of JMP you are using the bar heights  and the labels do not seem to match the left, Y, Axis.

 

I do not know of a point and click method to specify a format for the Bar or Boxplot labels. If your version allows you to Add > Caption, You can create a graph like the one displayed below without scripting.  Captions seem to show smarter formatting, than labels. If the format of the Y variable (weight for the example below) is Fixed with 0 decimals, the caption mean will be reported with 1 decimal. If the format of Y was Fixed with 2 decimals then the caption mean would have 3 decimals. If the format is best then each group has different formats, based upon "Best." 

 

The steps to create this and the script can be found below.  With JSL you can create a script to add a custom label to each bar, but to keep it current with exclusions, the scripting becomes more advanced.

 

image.png

Steps:

  1. Drag Y variable to the Y axis.
  2. Right click in the graph and select Points and Change to Bar
  3. Right click in the graph and select Add Caption
  4. Right click in the graph and select Customize. The click on Text then click on the Font button and select Bold.
  5. Drag the nominal varaible to the X group area at the top. For this example, drag column age.  Note all the bars have bolded Means.
  6. Right click on the X Group Area and select X Group Edge, select Bottom

Note that the format for column weight was Fixed  width=5 and decimals=0, so the mean has exactly 1 decimal point in the caption.

Names default to here(1);

dt = Open("$sample_data/big class.jmp");


gb = dt << Graph Builder(
	Size( 534, 454 ),
	Show Control Panel( 0 ),
	X Group Edge( "Bottom" ),
	Variables( Y( :weight ), Group X( :age ) ),
	Elements( Bar( Y, Legend( 1 ) ), Caption Box( Y, Legend( 2 ) ) )
);

tseg = gb << Xpath("//FrameBox//TextSeg");
tseg <<  {Font( "Segoe UI", 8, "Bold" )};

Attached is a script that demonstrates customizing boxplots. It does not have the added code to manage exclusions ( it requires a row state handler). It demonstrates some of the steps required to figure out placement and formatting of custom labels.

 

 

0 Kudos
Yu
Yu
Community Trekker

Re: when i use graph builder to plot Bar chart, how do I display a decimal?

thank  you very much

0 Kudos