turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Discussions
- :
- Overlay variable for ONE graph only

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jul 28, 2017 5:40 AM
(2537 views)

I am trying to replicate a graph for which I have downloaded the exact same data but I am having trouble using overlay selectively.

This is the original graph:

and this is the most I manage to get:

My biggest issue is getting the accumulated black line. As I use overlay to create the stacked bars, the overlay applies to the points too and I end up getting plenty of points/lines...

Is there a way to have the overlay apply to only one of the graphs? Maybe via JSL?

While we are at it...:) As you can see, the other difference between the graphs is the order of the variables within the bars...can this be changed?

Thanks in advance!

2 ACCEPTED SOLUTIONS

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Aug 16, 2017 7:25 AM
(4626 views)

Solution

*While we are at it...:) As you can see, the other difference between the graphs is the order of the variables within the bars...can this be changed?*

Right click on the column header for the variable in question.

Select Column Info

Click Column Properties > Value Ordering

Rearrange the values according to your desired sort order

Programmatically you can do this like so:

```
dt = New Table( "", Add Rows( 3 ),
New Column( "Column 1", Character, "Nominal",
Set Values( {"a", "b", "c"} )
)
);
column(dt, "Column 1") << Set Property( "Value Ordering", {"c", "a", "b"} );
```

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Aug 25, 2017 10:04 AM
(4517 views)

Solution

What you want to do is probably best accomplished by creating an aggregate column (either a formula column in the data table, or a virtual column in the Graph Builder platform). This column would be the sum of your measures grouped by your X variable. Then:

1. place your data column and the aggregate column in the Y-role in Graph Builder

2. place your X and overlay variables in the appropriate roles

3. select the Bar Chart (Stacked) element and turn off the aggregate variable

4. then add the line element (shift-click) and turn off the data variable (leaving the aggregate and X variables checked)

5. follow step #4 for the points element if desired (turn off the jitter option)

6. Double-click the legend to edit what is displayed, i.e. captions and line colors

I've enclosed a sample file with a Graph Builder script... hope this helps.

6 REPLIES

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Aug 14, 2017 8:40 PM
(2439 views)

in Graph Builder, when the control panel is on, look on the left hand side where all the graph elements are. At the bottom of each element, in your case, the Line element, there is a little grey disclosure triangle infront of the the word "variables" click that grey triangle and then select which Y variables you want to use for the line, noting that you'll likely also need to include your X variable too.

JMP Systems Engineer, Pharm and BioPharm Sciences

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Aug 16, 2017 7:25 AM
(4627 views)

*While we are at it...:) As you can see, the other difference between the graphs is the order of the variables within the bars...can this be changed?*

Right click on the column header for the variable in question.

Select Column Info

Click Column Properties > Value Ordering

Rearrange the values according to your desired sort order

Programmatically you can do this like so:

```
dt = New Table( "", Add Rows( 3 ),
New Column( "Column 1", Character, "Nominal",
Set Values( {"a", "b", "c"} )
)
);
column(dt, "Column 1") << Set Property( "Value Ordering", {"c", "a", "b"} );
```

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Aug 24, 2017 4:11 AM
(2345 views)

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Aug 24, 2017 3:57 AM
(2350 views)

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Aug 25, 2017 10:04 AM
(4518 views)

What you want to do is probably best accomplished by creating an aggregate column (either a formula column in the data table, or a virtual column in the Graph Builder platform). This column would be the sum of your measures grouped by your X variable. Then:

1. place your data column and the aggregate column in the Y-role in Graph Builder

2. place your X and overlay variables in the appropriate roles

3. select the Bar Chart (Stacked) element and turn off the aggregate variable

4. then add the line element (shift-click) and turn off the data variable (leaving the aggregate and X variables checked)

5. follow step #4 for the points element if desired (turn off the jitter option)

6. Double-click the legend to edit what is displayed, i.e. captions and line colors

I've enclosed a sample file with a Graph Builder script... hope this helps.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Aug 27, 2017 7:44 PM
(2217 views)

Great! That works! I was too biased thinking that this should be possible straight away in graph builder to even think of manipulating the table... :)

Actually I think it would be a great feature to have the overlay, color and size (and probably other) fields to accept multiple variables that could then be selected on the variables under each graph type (points, bars...) that is being used.

For completeness, I had another workaround in mind involving creating the two separate graphs and then "Right click on one of the graph blank space-->Edit-->Copy frame contents" and then go to the other graph and "Paste frame contents". This should do the job but I think the graph is not changeable anymore or can be saved.