<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Is There a Way to Create A Stacked Bar Chart with Total Lables? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Is-There-a-Way-to-Create-A-Stacked-Bar-Chart-with-Total-Lables/m-p/272306#M52960</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to use the graph builder to create stacked bar chart with labels for each stacked bar as well as a sum total.&amp;nbsp; The image below is a marked up version of the graph I am hoping to achieve where I have manually inserted the totals for each bar.&amp;nbsp; (The sample JMP dataset I used along with the embedded graph builder script is attached)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know if there is a way to create this view via the graph builder/another platform or JSL scripting?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;AW&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Graph Builder Stacked Bar Chart.jpg" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/24557i028F89ADBAD2A364/image-size/large?v=v2&amp;amp;px=999" role="button" title="Graph Builder Stacked Bar Chart.jpg" alt="Graph Builder Stacked Bar Chart.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 11 Jun 2023 11:02:03 GMT</pubDate>
    <dc:creator>AW</dc:creator>
    <dc:date>2023-06-11T11:02:03Z</dc:date>
    <item>
      <title>Is There a Way to Create A Stacked Bar Chart with Total Lables?</title>
      <link>https://community.jmp.com/t5/Discussions/Is-There-a-Way-to-Create-A-Stacked-Bar-Chart-with-Total-Lables/m-p/272306#M52960</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to use the graph builder to create stacked bar chart with labels for each stacked bar as well as a sum total.&amp;nbsp; The image below is a marked up version of the graph I am hoping to achieve where I have manually inserted the totals for each bar.&amp;nbsp; (The sample JMP dataset I used along with the embedded graph builder script is attached)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know if there is a way to create this view via the graph builder/another platform or JSL scripting?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;AW&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Graph Builder Stacked Bar Chart.jpg" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/24557i028F89ADBAD2A364/image-size/large?v=v2&amp;amp;px=999" role="button" title="Graph Builder Stacked Bar Chart.jpg" alt="Graph Builder Stacked Bar Chart.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Jun 2023 11:02:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Is-There-a-Way-to-Create-A-Stacked-Bar-Chart-with-Total-Lables/m-p/272306#M52960</guid>
      <dc:creator>AW</dc:creator>
      <dc:date>2023-06-11T11:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: Is There a Way to Create A Stacked Bar Chart with Total Lables?</title>
      <link>https://community.jmp.com/t5/Discussions/Is-There-a-Way-to-Create-A-Stacked-Bar-Chart-with-Total-Lables/m-p/272321#M52961</link>
      <description>&lt;P&gt;You can add your own custom graphic scripts to Graph Builder,&amp;nbsp; Right click on the graph, and select Custom and you will see the JSL added.&amp;nbsp; I only added the code for the top 2 bars, but it should show you how to move ahead with all of them.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="custom.PNG" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/24558iE3EE90964981A12B/image-size/large?v=v2&amp;amp;px=999" role="button" title="custom.PNG" alt="custom.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Attached is the script&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2020 03:20:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Is-There-a-Way-to-Create-A-Stacked-Bar-Chart-with-Total-Lables/m-p/272321#M52961</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-06-12T03:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: Is There a Way to Create A Stacked Bar Chart with Total Lables?</title>
      <link>https://community.jmp.com/t5/Discussions/Is-There-a-Way-to-Create-A-Stacked-Bar-Chart-with-Total-Lables/m-p/272343#M52968</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/7144"&gt;@AW&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;provided a good solution. It takes a bit of scripting for the labels.&amp;nbsp; Here is another method using GraphBuilder.&amp;nbsp; I think it is easier to see the pattern via the saved script (below). This can be done via the UI and turning off Overlay variable. The graph has 3 Elements:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;a stacked bar using the overlay variable&lt;/LI&gt;
&lt;LI&gt;a bar not using the overlay variable&lt;/LI&gt;
&lt;LI&gt;a caption with Summary Statistic Sum not using the overlay variable&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Note I saved your data table to my c:/temp/ drive. The Caption elemnet does not have the flexibility of placement that Jim's solution provides.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);

dt = open("C:/temp/Sample Dataset for Stacked Graph Builder Bar Chart.jmp");

gb = dt &amp;lt;&amp;lt;  Graph Builder(
	Size( 534, 492 ),
	Show Control Panel( 0 ),
	Variables(
		X( :Test_Step_Duration ),
		Y( :Test ),
		Group X( :Sample Information ),
		Overlay( :Test_Step )
	),
	Elements(
		Bar(
			X,
			Y,
			Overlay( 0 ),
			Legend( 11 ),
			Bar Style( "Stacked" ),
			Summary Statistic( "Sum" )
		),
		Caption Box(
			X,
			Y,
			Overlay( 0 ),
			Legend( 13 ),
			Summary Statistic( "Sum" ),
			Per Factor( 1 )
		),
		Bar( X, Y, Legend( 14 ), Bar Style( "Stacked" ), Label( "Label by Value" ) )
	),
	Local Data Filter(
		Add Filter( columns( :Project ), Where( :Project == "Project 1" ) )
	),
	SendToReport(
		Dispatch(
			{},
			"Test_Step_Duration",
			ScaleBox,
			{Label Row( Show Major Grid( 1 ) )}
		),
		Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				11,
				Properties(
					-1,
					{Transparency( 0.1 )},
					Item ID( "Sum(Test_Step_Duration)", 1 )
				)
			), Legend Model(
				14,
				Properties( 0, {Fill Color( 69 )}, Item ID( "Step 1", 1 ) ),
				Properties( 1, {Fill Color( 67 )}, Item ID( "Step 2", 1 ) ),
				Properties( 2, {Fill Color( 36 )}, Item ID( "Step 3", 1 ) ),
				Properties( 3, {Fill Color( 40 )}, Item ID( "Step 4", 1 ) ),
				Properties( 4, {Fill Color( 38 )}, Item ID( "Step 5", 1 ) ),
				Properties( 5, {Fill Color( 39 )}, Item ID( "Step 6", 1 ) )
			)}
		),
		Dispatch(
			{},
			"X title",
			TextEditBox,
			{Set Text( "Test_Step_Duration and Total" )}
		),
		Dispatch(
			{},
			"400",
			LegendBox,
			{Legend Position( {11, [-1], 14, [0, 1, 2, 3, 4, 5]} ),
			Position( {-1, 0, 1, 2, 3, 4, 5} )}
		)
	)
);

txtseg = gb &amp;lt;&amp;lt; Xpath("//TextSeg");
txtseg &amp;lt;&amp;lt; Set Font("Segoe UI", 10, "Bold");
txtseg[1] &amp;lt;&amp;lt; {Transparency( 0 ), Text Color( "White" )};  //clear out the statistic

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/24559i6DB2E4E7C992FDB0/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2020 08:41:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Is-There-a-Way-to-Create-A-Stacked-Bar-Chart-with-Total-Lables/m-p/272343#M52968</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2020-06-12T08:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: Is There a Way to Create A Stacked Bar Chart with Total Lables?</title>
      <link>https://community.jmp.com/t5/Discussions/Is-There-a-Way-to-Create-A-Stacked-Bar-Chart-with-Total-Lables/m-p/272425#M52984</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/70"&gt;@gzmorgan0&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for the quick replies and creative ways to solve this issue!&amp;nbsp; I neglected to mention that I will need to cycle through and generate these plots for ~100 different projects per week.&amp;nbsp; So, I think the script provided by gzmorgan0 is a better fit for me. I just tried it out and it works perfectly for my needs.&amp;nbsp; Thanks again!&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2020 15:15:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Is-There-a-Way-to-Create-A-Stacked-Bar-Chart-with-Total-Lables/m-p/272425#M52984</guid>
      <dc:creator>AW</dc:creator>
      <dc:date>2020-06-12T15:15:16Z</dc:date>
    </item>
  </channel>
</rss>

