Subscribe Bookmark RSS Feed

multi chart and break page

KinKame

Community Trekker

Joined:

Nov 30, 2015

Hello still need some help

I created multi charts using a for loop

problem is I would like to insert a break page after each graph but it doesn't work

here is part of the code (pretty long so I cut it)

my_window = new window (" report", <-- define new window

  V list Box(

  Text box( "(1) Definition", << set font size(textsize1), justify text(left), << font color({0,0,0.5})),

<code cut only text box>

  page break box(), <-- this break page works

  current data table (final_tb);

  For( k = 1, k <= NRow(::cor_data), k++, <-- for loop to create multi graph

  obj = final_tb << Fit Group(

  Bivariate( <-- graph 1

  Y(col_sel_Y),

  X(col_sel_X),

<code cut graph>

  )

  ),

  Oneway( <-- graph 2

  Y(col_sel_Y),

  X( :REGION ),

<code cut graph>

  );

  obj << Title("Param to inline correlation_"||char(chart_key));

    obj << journal; <-- append to journal but actually would like to happen to my_window

    page break box() << journal; <-- here is my break page issue ... I cannot figure out how to code it.

  )

);

If I create the charts and then paste them into current journal it works but then I see around 20 graphs popping on my screen !!

best regards

Lionel

2 REPLIES
ms

Super User

Joined:

Jun 23, 2011

See below for a slight rearrangement of your code. The main difference is that the for-loop is run after New Window() is created. A window must exist before appending boxes to it. Big Class.jmp is used as example table.

final_tb = Open("$SAMPLE_DATA/Big Class.jmp"); //Example table

//Create new window

my_window = New Window(" report", // define new window

    vlb = V List Box(Text Box("(1) Definition", <<set font size(15), justify text(left), <<font color({0, 0, 0.5})), Page Break Box())

);

// for loop to create multi graph and append to my_window

For(k = 1, k <= 5, k++,

    vlb2 = V List Box(

        Text Box("Param to inline correlation_" || Char(k), <<set font size(12), justify text(left), <<font color({0, 0.5, 0.5})),

        final_tb << Bivariate( // graph 1

            Y(:height),

            X(:weight)

        ),

        Oneway( // graph 2

            Y(:height),

            X(:sex)

        )

    );

    //vlb2 << Title("Param to inline correlation_" || Char(k));

    vlb << append(vlb2) << append(Page Break Box()); // append  my_window

);

KinKame

Community Trekker

Joined:

Nov 30, 2015

Thank you MS.

hmm i didnt think about double append...

i just dont understand why append to vlb and not my_window

vlb << append(vlb2) << append(Page Break Box()); and not my_window << append(vlb2) << append(Page Break Box());


maybe because by construction vlb is already append to my_window?!?