I have reworked the script, showing how the picture form of the pie chart can be incorporated into the final display
/* 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 << 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) << GetPicture;
win = NewWindow( "Customer Service Scorecard",
TextBox( "Customer Service Scorecard", <<setFontSize(16), <<SetFontStyle("Bold"), <<setWrap(800),
<<SetWidth(600), <<JustifyText("center")
),
TextBox( "September 2017", <<setFontSize(14), <<SetFontStyle("Bold"), <<setWrap(800),
<<SetWidth(600), <<JustifyText("center")
),
TextBox( " " ),
VListBox(
HListBox(
OutlineBox( "Customer Satisfaction",
TextBox( " " ),
TextBox( "97%", <<setFontSize(40), <<SetFontStyle("Bold"), <<SetWidth(300), <<JustifyText("center") ),
TextBox( "of customers are satisfied", <<setFontSize(9), <<SetWidth(300), <<JustifyText("center") )
),
dt1 << 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( " ", <<SetWidth(300) ),
DataTableBox( dt2 )
)
)
)
);
//jrn = CurrentJournal();
/* How do I combine the picture with the rest of the scorecard? */
//jrn << Append( thepicture );
//jrn = win << Journal;
Jim