- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
How to resize the Graph Builder Panel size when using the Page/arrange in row organization
Hey everyone,
I was hoping someone could help me figure out the code to resize the panel size in graph builder.
This is from the big class data set:
If I wanted to set the size to be much bigger using JSL (the auto fit window is turned off) to something like this:
how would I accomplish that?
The reason I need this functionality is that currently if you use a filter for the "Page" column then the graphs get smaller and smaller the more levels you have. When you have a ton of levels it can get so small you can't even see the handle to resize the Panels. So I have to select some levels, resize, select some more levels, resize, etc.....Very annoying and removes some of the awesomeness of this new Graph Builder ability. On the flip side, if you have a ton of levels sized right as you remove levels in the filter the charts get bigger and bigger.
So I want to be able to have an input box through JSL where I can change the sizing easily and quickly.
Hope this make sense and thanks for any ideas!
Steve
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to resize the Graph Builder Panel size when using the Page/arrange in row organization
It has to be triggered somehow, most likely by some control or handler (in that example, you can for example call the same function before filter handler is applied with something like f(0))
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
nw = New Window("",
gb = dt << Graph Builder(
Size(569, 357),
Show Control Panel(0),
Replicate Linked Page Axes(0),
Fit to Window("Off"),
Variables(X(:height), Y(:weight), Page(:age, Levels per Row(3))),
Elements(Points(X, Y, Legend(91)), Smoother(X, Y, Legend(92)))
)
);
ldf = gb << Local Data Filter(
Add Filter(
columns(:age),
Where(:age == {12, 13, 14, 15, 16, 17}),
Display(:age, N Items(6))
)
);
change_frame_size = Function({a},
fbs = Report(gb) << XPath("//FrameBox");
fbs << Frame Size(500, 500);
);
change_frame_size(0);
rs = ldf << Make Filter Change Handler(change_frame_size);
Below is the most simple case where it is triggered by button press
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
nw = New Window("",
V List Box(
Button Box("Update Frames",
(Report(window:gb) << XPath("//FrameBox")) << Frame Size(300, 300);
),
window:gb = dt << Graph Builder(
Size(569, 357),
Show Control Panel(0),
Replicate Linked Page Axes(0),
Fit to Window("Off"),
Variables(X(:height), Y(:weight), Page(:age, Levels per Row(3))),
Elements(Points(X, Y, Legend(91)), Smoother(X, Y, Legend(92))),
Local Data Filter(
Add Filter(
columns(:age),
Where(:age == {12, 13, 14, 15, 16, 17}),
Display(:age, N Items(6))
)
)
)
)
);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to resize the Graph Builder Panel size when using the Page/arrange in row organization
I'm not sure if there are any other options than controlling this by JSL, but you can change the frame size (if there isn't this could be worth creating wish list item. "lock window size" for data filters as we already have "lock scales")
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
nw = New Window("",
gb = dt << Graph Builder(
Size(569, 357),
Show Control Panel(0),
Replicate Linked Page Axes(0),
Fit to Window("Off"),
Variables(X(:height), Y(:weight), Page(:age, Levels per Row(3))),
Elements(Points(X, Y, Legend(91)), Smoother(X, Y, Legend(92)))
)
);
ldf = gb << Local Data Filter(
Add Filter(
columns(:age),
Where(:age == {12, 13, 14, 15, 16, 17}),
Display(:age, N Items(6))
)
);
f = Function({a},
fbs = Report(gb) << XPath("//FrameBox");
fbs << Frame Size(300, 300);
);
rs = ldf << Make Filter Change Handler(f);
You might want to want to add some sort of "size forcing" to the graph builder/your window so the window won't keep resizing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to resize the Graph Builder Panel size when using the Page/arrange in row organization
Thanks Jarmo! This is really close but it looks like when I run this section of the code with a new size:
f = Function({a},
fbs = Report(gb) << XPath("//FrameBox");
fbs << Frame Size(500, 500);
);
rs = ldf << Make Filter Change Handler(f);
that graph builder doesn't update the size of the charts until I change the filter options. Is there a way to force the chart to update the size without the filter needing to be changed?
The plan is to have a floating window where I can input different frame sizes depending on how many levels I have selected after the selection is completed.
Thanks for any additional input!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to resize the Graph Builder Panel size when using the Page/arrange in row organization
It has to be triggered somehow, most likely by some control or handler (in that example, you can for example call the same function before filter handler is applied with something like f(0))
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
nw = New Window("",
gb = dt << Graph Builder(
Size(569, 357),
Show Control Panel(0),
Replicate Linked Page Axes(0),
Fit to Window("Off"),
Variables(X(:height), Y(:weight), Page(:age, Levels per Row(3))),
Elements(Points(X, Y, Legend(91)), Smoother(X, Y, Legend(92)))
)
);
ldf = gb << Local Data Filter(
Add Filter(
columns(:age),
Where(:age == {12, 13, 14, 15, 16, 17}),
Display(:age, N Items(6))
)
);
change_frame_size = Function({a},
fbs = Report(gb) << XPath("//FrameBox");
fbs << Frame Size(500, 500);
);
change_frame_size(0);
rs = ldf << Make Filter Change Handler(change_frame_size);
Below is the most simple case where it is triggered by button press
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
nw = New Window("",
V List Box(
Button Box("Update Frames",
(Report(window:gb) << XPath("//FrameBox")) << Frame Size(300, 300);
),
window:gb = dt << Graph Builder(
Size(569, 357),
Show Control Panel(0),
Replicate Linked Page Axes(0),
Fit to Window("Off"),
Variables(X(:height), Y(:weight), Page(:age, Levels per Row(3))),
Elements(Points(X, Y, Legend(91)), Smoother(X, Y, Legend(92))),
Local Data Filter(
Add Filter(
columns(:age),
Where(:age == {12, 13, 14, 15, 16, 17}),
Display(:age, N Items(6))
)
)
)
)
);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to resize the Graph Builder Panel size when using the Page/arrange in row organization
That works like a charm, thanks!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to resize the Graph Builder Panel size when using the Page/arrange in row organization
Wanted to add where I ended up with based upon your code, give a floating window where I can interactively size the panels to my liking:
//rev 5-5-24
Names Default To Here(1);
dt=current data table();
obj=current report()["Graph Builder"]<< get scriptable object;
obj1 = obj << Get Window Title;
s = Window(obj1)<< Get Window Size();
nw = New Window("Resize Graph Builder Page Panels",Show Menu( 0 ),Show Toolbars( 0 ),
V List Box(
h list box(
vlist box(
text box("frame Size Y"),
neb1=Number Edit Box( 250 );
),
vlistbox(
textbox("frame Size X"),
neb2=Number Edit Box( 350 );
)
),
Button Box("Update Frames",
Report(obj)<< Fit to Window("Off");
nebval1=neb1 << Get;
nebval2=neb2 << Get;
(Report(obj) << XPath("//FrameBox")) << Frame Size(nebval2, nebval1);
window(obj1) << Set Window Size( s );
),
)
);
nw << Size Window( 400, 200 );
window(obj) << On Close(window("Resize Graph Builder Page Panels")<<Close Window);