<?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 Annotate Pie Chart (from Graph Builder) with JSL in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Annotate-Pie-Chart-from-Graph-Builder-with-JSL/m-p/46360#M26422</link>
    <description>&lt;P&gt;I have written JSL to create a Pie Chart (from Graph Builder):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Pie.png" style="width: 274px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/8133i199936AB5B1BA840/image-size/large?v=v2&amp;amp;px=999" role="button" title="Pie.png" alt="Pie.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I would like to annotate this Pie Chart (under&amp;nbsp;its legend) with text that says "Responses: 14", for example:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Pie_Annotated.png" style="width: 274px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/8134i24ABDF7448087DB0/image-size/large?v=v2&amp;amp;px=999" role="button" title="Pie_Annotated.png" alt="Pie_Annotated.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to do this with JSL?&amp;nbsp; My current script is attached as a file.&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2023 23:24:28 GMT</pubDate>
    <dc:creator>jb</dc:creator>
    <dc:date>2023-06-09T23:24:28Z</dc:date>
    <item>
      <title>Annotate Pie Chart (from Graph Builder) with JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Annotate-Pie-Chart-from-Graph-Builder-with-JSL/m-p/46360#M26422</link>
      <description>&lt;P&gt;I have written JSL to create a Pie Chart (from Graph Builder):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Pie.png" style="width: 274px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/8133i199936AB5B1BA840/image-size/large?v=v2&amp;amp;px=999" role="button" title="Pie.png" alt="Pie.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I would like to annotate this Pie Chart (under&amp;nbsp;its legend) with text that says "Responses: 14", for example:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Pie_Annotated.png" style="width: 274px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/8134i24ABDF7448087DB0/image-size/large?v=v2&amp;amp;px=999" role="button" title="Pie_Annotated.png" alt="Pie_Annotated.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to do this with JSL?&amp;nbsp; My current script is attached as a file.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 23:24:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Annotate-Pie-Chart-from-Graph-Builder-with-JSL/m-p/46360#M26422</guid>
      <dc:creator>jb</dc:creator>
      <dc:date>2023-06-09T23:24:28Z</dc:date>
    </item>
    <item>
      <title>Re: Annotate Pie Chart (from Graph Builder) with JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Annotate-Pie-Chart-from-Graph-Builder-with-JSL/m-p/46369#M26428</link>
      <description>&lt;P&gt;All that has to be done to accomplish this, is to add the annotation to the chart, and then to get the script with the annotation.&amp;nbsp; Once you have that, some minor changes and you have your script.&amp;nbsp; The major change was that the annotation would not transfer to the journal, but by copying the output into a picture structure, and then posting that picture to the journal, one has the end results you want.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Clear Log();
Names Default To Here( 1 );

dt = New Table( "Responses",
	AddRows( 4 ),
	New Column( "Status", Character( 7 ), "Nominal", Set Values( {"Late", "N/A", "On Time", "Pending"} ) ),
	New Column( "Count", Numeric, "Continuous", Format( "Fixed Dec", 12, 0 ), Set Values( [2, 0, 11, 1] ) )
);

total = 14;
thetext = "Responses\!n" || char(total);
win = New Window( "Scorecard",
	gb = dt &amp;lt;&amp;lt; GraphBuilder(
		Size( 150, 180 ),
		ShowControlPanel( 0 ),
		Variables( X( :Status ), Y( :Name( "Count" ) ) ),
		Elements( Pie( X, Y, Legend( 2 ), Label( "Label by Value" ) ) ),
		SendToReport(
			Dispatch(
				{},
				"400",
				ScaleBox,
				{Legend Model(
					2,
					Properties( 0, {Fill Color( {247, 150, 70} )} ),  /* Late:     orange */
					Properties( 1, {Fill Color( {200, 200, 200} )} ),  /* N/A:      grey   */
					Properties( 2, {Fill Color( {155, 187, 89} )} ),  /* On Time:  green  */
					Properties( 3, {Fill Color( {192, 80, 77} )} )   /* Pending:  red    */
				)}
			),
			Dispatch(
			{},
			"",
			GraphBuilderContainerBox,
			Add Text Annotation(
				Text( theText ),
				Text Box( {159, 94, 232, 133} ),
				Background Color( "White" )
			)
		),
			Dispatch( {}, "Graph Builder", OutlineBox, {SetTitle( "Survey Responses (Q3 2017)" )} ),
			Dispatch( {}, "graph title", TextEditBox, {SetText( "" )} ),
			Dispatch( {}, "X title", TextEditBox, {SetText( "John Doe (pending)" )} ),
			Dispatch( {}, "Y title", TextEditBox, {SetText( "" )} ),
			Dispatch( {}, "400", LegendBox, {SetTitle( "" )} )
		)
	)
);
thepicture=report(gb)&amp;lt;&amp;lt;get picture;
jrn = Current Journal();
jrn&amp;lt;&amp;lt;append(thepicture);
Close All( Reports, NoSave );
Close( dt, NoSave );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Oct 2017 21:09:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Annotate-Pie-Chart-from-Graph-Builder-with-JSL/m-p/46369#M26428</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-10-24T21:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: Annotate Pie Chart (from Graph Builder) with JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Annotate-Pie-Chart-from-Graph-Builder-with-JSL/m-p/46877#M26704</link>
      <description>&lt;P&gt;Thanks, Jim.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OK, I&amp;nbsp;see that the TextBox is not actually part of GraphBuilder, but rather a picture placed on top of it.&amp;nbsp; I was able to run your script successfully to create a journal containing one picture.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What if the&amp;nbsp;picture was part of a 2x2 scorecard?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;OutlineBox with Text&lt;/LI&gt;&lt;LI&gt;Bar Chart&lt;/LI&gt;&lt;LI&gt;Picture (Pie Chart with Annotation)&lt;/LI&gt;&lt;LI&gt;OutlineBox with Table&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the attached script, how&amp;nbsp;would I combine the picture with the rest of the scorecard?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2017 22:52:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Annotate-Pie-Chart-from-Graph-Builder-with-JSL/m-p/46877#M26704</guid>
      <dc:creator>jb</dc:creator>
      <dc:date>2017-11-07T22:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: Annotate Pie Chart (from Graph Builder) with JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Annotate-Pie-Chart-from-Graph-Builder-with-JSL/m-p/46878#M26705</link>
      <description>&lt;P&gt;I have reworked the script, showing how the picture form of the pie chart can be incorporated into the final display&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;/* Scorecard with Annotated Pie */

ClearLog();
NamesDefaultToHere(1);

dt1 = NewTable( "Table1", AddRows(5),
	NewColumn( "Channel", Character, Nominal,
		SetValues({"Call","Email","Facebook","Twitter","Visit"}) ),
	NewColumn( "Pct of Customers", Continuous, Format("Percent"),
		SetValues({.1, .05, .4, .35, .08}) )
);
dt2 = NewTable( "Table2", AddRows(5),
	NewColumn( "Team Member", Character, Nominal,
		SetValues({"Sales Asst A","Sales Asst B","Sales Asst C","Sales Asst D","Sales Asst E"}) ),
	NewColumn( "Rating", Character, Nominal,
		SetValues({"Excellent","Very Good","Excellent","Excellent","Excellent"}) )
);
dt = New Table( "Responses",
	AddRows( 4 ),
	New Column( "Status", Character( 7 ), "Nominal", Set Values( {"Late", "N/A", "On Time", "Pending"} ) ),
	New Column( "Count", Numeric, "Continuous", Format( "Fixed Dec", 12, 0 ), Set Values( [2, 0, 11, 1] ) )
);
gb = dt &amp;lt;&amp;lt; GraphBuilder(invisible,
        Size( 150, 180 ),
        ShowControlPanel( 0 ),
        Variables( X( :Status ), Y( :Name( "Count" ) ) ),
        Elements( Pie( X, Y, Legend( 2 ), Label( "Label by Value" ) ) ),
        SendToReport(
          Dispatch({}, "400", ScaleBox, {LegendModel( 2,
              Properties( 0, {FillColor({247, 150, 70})} ),
              Properties( 1, {FillColor({200, 200, 200})} ),
              Properties( 2, {FillColor({155, 187, 89})} ),
              Properties( 3, {FillColor({192, 80, 77})} )
            )}
          ),
          Dispatch({}, "", GraphBuilderContainerBox, AddTextAnnotation(
            Text("Responses 14"), TextBox({157, 102, 232, 135}), BackgroundColor("White")
          )),
          Dispatch( {}, "Graph Builder", OutlineBox, {SetTitle("Survey Responses")} ),
          Dispatch( {}, "graph title", TextEditBox, {SetText("")} ),
          Dispatch( {}, "X title", TextEditBox, {SetText("John Doe (pending)")} ),
          Dispatch( {}, "Y title", TextEditBox, {SetText("")} ),
          Dispatch( {}, "400", LegendBox, {SetTitle("")} )
        )
      );
thepicture = report(gb) &amp;lt;&amp;lt; GetPicture;

win = NewWindow( "Customer Service Scorecard",
  TextBox( "Customer Service Scorecard", &amp;lt;&amp;lt;setFontSize(16), &amp;lt;&amp;lt;SetFontStyle("Bold"), &amp;lt;&amp;lt;setWrap(800),
    &amp;lt;&amp;lt;SetWidth(600), &amp;lt;&amp;lt;JustifyText("center")
  ),
  TextBox( "September 2017", &amp;lt;&amp;lt;setFontSize(14), &amp;lt;&amp;lt;SetFontStyle("Bold"), &amp;lt;&amp;lt;setWrap(800),
    &amp;lt;&amp;lt;SetWidth(600), &amp;lt;&amp;lt;JustifyText("center")
  ),
  TextBox( " " ), 
  VListBox(
    HListBox(
      OutlineBox( "Customer Satisfaction",
        TextBox( " " ),
        TextBox( "97%", &amp;lt;&amp;lt;setFontSize(40), &amp;lt;&amp;lt;SetFontStyle("Bold"), &amp;lt;&amp;lt;SetWidth(300), &amp;lt;&amp;lt;JustifyText("center") ),
        TextBox( "of customers are satisfied", &amp;lt;&amp;lt;setFontSize(9), &amp;lt;&amp;lt;SetWidth(300), &amp;lt;&amp;lt;JustifyText("center") )
      ),
      dt1 &amp;lt;&amp;lt; GraphBuilder(
        Size(300,200), ShowControlPanel(0), ShowLegend(0),
        Variables( X(:Channel), Y(:Pct of Customers) ),
        Elements( Bar( X,Y,Legend(6) ) ),
        SendToReport(
          Dispatch({}, "Graph Builder", OutlineBox, {Set Title("Preferred Channels")}),
          Dispatch({}, "Channel", ScaleBox, {Labe Row(LabelOrientation("Angled"))}),
          Dispatch({}, "graph title", TextEditBox, {SetText("")}),
          Dispatch({}, "400", LegendBox, {SetTitle("")})
        )
      )
    ),
    HListBox(
      
      thepicture,
      
      
      OutlineBox( "Winning Interactions",
        TextBox( " ", &amp;lt;&amp;lt;SetWidth(300) ),
        DataTableBox( dt2 )  
      )
    )
  )
);



//jrn = CurrentJournal();

/* How do I combine the picture with the rest of the scorecard? */

//jrn &amp;lt;&amp;lt; Append( thepicture );
//jrn = win &amp;lt;&amp;lt; Journal;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Nov 2017 23:13:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Annotate-Pie-Chart-from-Graph-Builder-with-JSL/m-p/46878#M26705</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-11-07T23:13:19Z</dc:date>
    </item>
  </channel>
</rss>

