Rect
Rect using Text Edit Box
Example 1
Summary: Creates a bar chart from a data table, utilizing text edit boxes, titles, labels, and rectangles for customization.
Code:
cert text edit bx = {Text Edit Box( "N", default font id( 9 ), wrapWidth( 277 ), justification( 1 ), vjustification( 1 ), left )};
cert title = {Title( "Type" )};
cert labels = {"Labels", Labels( "Aerospace", "Beverages", "Computer", "Drugs", "Oil", "Soap" )};
cert rect = {Rect( 0.855595667870036, 11, 0.945848375451264, 0, 1 ), Rect( 0.693140794223827, 27, 0.783393501805054, 0, 1 ),
Rect( 0.530685920577617, 12, 0.620938628158845, 0, 1 ), Rect( 0.371841155234657, 22, 0.462093862815885, 0, 1 ),
Rect( 0.209386281588448, 7, 0.299638989169675, 0, 1 ), Rect( 0.0469314079422383, 18, 0.137184115523466, 0, 1 )};
dt = Open("data_table.jmp");
obj = dt << Chart(
X( :Type ),
Y( N ),
Level[1] << Colors( 72 ),
Level[2] << Colors( 72 ),
Level[3] << Colors( 72 ),
Level[4] << Colors( 72 ),
Level[5] << Colors( 72 ),
Level[6] << Colors( 72 ),
Bar Chart( 1 )
);
rpt = obj << report;
Code Explanation:
- Define text edit box.
- Define title.
- Define labels.
- Define rectangles.
- Open data table.
- Create chart object.
- Set X axis variable.
- Set Y axis variable.
- Set colors for levels.
- Generate bar chart.
Example 2
Summary: Creates a bar chart report from a data table, defining text edit box, title, labels, and rectangles for visualization.
Code:
cert textedit bx = {Text Edit Box( "N", default font id( 9 ), wrapWidth( 277 ), justification( 1 ), vjustification( 1 ), left )};
cert title = {Title( "age" )};
cert labels = {"Labels", Labels( "12", "13", "14", "15", "16", "17" )};
cert rect = {Rect( 0.855595667870036, 3, 0.945848375451264, 0, 1 ), Rect( 0.693140794223827, 3, 0.783393501805054, 0, 1 ),
Rect( 0.530685920577617, 7, 0.620938628158845, 0, 1 ), Rect( 0.371841155234657, 12, 0.462093862815885, 0, 1 ),
Rect( 0.209386281588448, 7, 0.299638989169675, 0, 1 ), Rect( 0.0469314079422383, 8, 0.137184115523466, 0, 1 )};
dt = Open("data_table.jmp");
obj = dt << Chart(
X( :age ),
Y( N ),
Level[1] << Colors( 72 ),
Level[2] << Colors( 72 ),
Level[3] << Colors( 72 ),
Level[4] << Colors( 72 ),
Level[5] << Colors( 72 ),
Level[6] << Colors( 72 ),
Bar Chart( 1 )
);
rpt = obj << report;
Code Explanation:
- Define text edit box.
- Define title.
- Define labels.
- Define rectangles.
- Open data table.
- Create chart object.
- Set X axis to age.
- Set Y axis to N.
- Set bar colors.
- Generate bar chart report.