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
- :
- Re: Overlay variable for ONE graph only

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

Highlighted

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

Jul 28, 2017 5:40 AM
(9308 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

Highlighted

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

*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"} );
```

Highlighted

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

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 6

Highlighted
##

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

Re: Overlay variable for ONE graph only

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

Highlighted

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

*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"} );
```

Highlighted
##

@pmroz Yes! that solves the order issue! I still have the problem with the total of the measures... I think it is just not possible to apply the overlay selectively...

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

Re: Overlay variable for ONE graph only

Highlighted
##

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

Re: Overlay variable for ONE graph only

Created:
Aug 24, 2017 3:57 AM
| Last Modified: Aug 24, 2017 4:12 AM
(9121 views)
| Posted in reply to message from Byron_JMP 08-14-2017

I have tried changing those but it does not help to get the dots to be the accumulated values... am I missing something there?

Highlighted

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

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.

Highlighted
##

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

Re: Overlay variable for ONE graph only

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.

Article Labels

There are no labels assigned to this post.