Using a second column as value labels OR How to plot one variable and have another appear as labelHi!
I have two x-variables:
Meeting.# is numeric ordinal (just the Row())
Meeting.ID is character nominal (can be date or some other text descriptor)
I need to plot attendance (X_2-X_8) against Meeting.# so that I can get a trend. But I want to display Meeting.ID as the x-axis labels.
I tried this approach: https://community.jmp.com/t5/Discussions/How-to-Add-Value-Labels-to-a-Column-through-JSL/td-p/41604
But had issues with type-mismatch.
There are other applications of this problem: Experiment.# and Experiment.Description
- Is there a better way to do this?
- Should the be done with Column Property Value Label or as part of Graph Builder?
- Ditto Value Ordering
- Should I submit a feature request?
Thanks!
Re: Using a second column as value labels OR How to plot one variable and have another appear as labThanks! Guess I can't use "Bullet" and Value labels together.
Re: Using a second column as value labels OR How to plot one variable and have another appear as labThe value for each segment within each bar can be added by specifying to "Label by Value" in the control panel for Graph Builder. Other labeling could be done using JSL, and "<< Add Graphics Script".Re: Using a second column as value labels OR How to plot one variable and have another appear as labHello,
Is there an elegant way to add the value of each bar in the graph, prefereably vertically on the bar?
Thanks!
Re: Using a second column as value labels OR How to plot one variable and have another appear as labThanks! From your script I know see why mine did not work:
Parse( "\!"" || Char(ValuesList[i]) || "\!" = \!"" || LabelsList[i] || "\!"" ) )
Re: Using a second column as value labels OR How to plot one variable and have another appear as labJim:
Thanks for the elegant solution!
Re: Using a second column as value labels OR How to plot one variable and have another appear as labMark, Jim's solution is a good one, and simpler to implement.
This is an FYI regarding your label script. Below is a script that will provide you with the labels you want. The value labels are assigned to :Meeting.#. Note, since :Meeting.# is numeric it does not require the "1" = "V1_0" but 1 = "V1_0".
Names Default To Here( 1 );
meetID = column("Meeting.#");
textID = column("X__10");
NamesValuesList = {};
For( i = 1, i <= nitems(meetID << get values ), i++,
Insert Into(
NamesValuesList,
Parse(
Char( meetID[i] ) || " = \!"" || textID[i] || "\!""
)
)
);
meetID << Set Property( "Value Labels", Eval( NamesValuesList ) );Re: Using a second column as value labels OR How to plot one variable and have another appear as labGreetings Mark,
Here is what I did to get to the solution that I believe you need
- Create an new column which has a formula of: :Meeting.ID || "[" || Char( :Meeting.# ) || "]" This makes each entry as a unique entry
- Then for the new column, I set the Column Property "Row Order Levels". This means that the order of this column will be the order within the data table that the value is found.
Below are the results I got using your Meeting Attendance BarChart with the column that I generated

I have attached the data table I used