I am new to JSL. My question is how to change the row state marker to the same value as a column. I have a column with 1,2,3,4....350. I want to display the number as my marker instead of diamons, * or cicrles in my graph builder. Any way to reference the column values in the marker state?
For example,
For Each Row( Row State( Row() ) = Marker State( :M) ) ); -> This changes the marker to M for all the data
For Each Row( Row State( Row() ) = Marker State( :Column("Die") ) ); -> This doesn't work.
I haven't used scripting. I am just curious on how it works. I really appreciate your time and effort.
Thanks for the help.
The value that you want to use as a label for a marker must be a value in a data column designated to be used as a label. In this example using Big Class data table, the name column is designated as a label column. You must further select all the rows to be labeled and then select Row > Label to apply the labels. In this case, I selected all of the rows. The result in Graph Builder looks like this:
Is this result what you want?
I suggest that you read Help > Books > Essential Graphing for more information and examples.
The row state is associated with an observation (row), not a variable (column). If you want to employ a different marker for each column, then you change the marker in Graph Builder. Here is a script for a simple example plotting columns 2-4 against column 1.
Graph Builder(
Show Control Panel( 0 ),
Show Legend( 0 ),
Variables(
X( :Name( "1" ) ),
Y( :Name( "2" ) ),
Y( :Name( "3" ), Position( 1 ) ),
Y( :Name( "4" ), Position( 1 ) )
),
Elements(
Points( X, Y( 1 ), Y( 2 ), Y( 3 ), Legend( 5 ) ),
Smoother( X, Y( 1 ), Y( 2 ), Y( 3 ), Legend( 6 ) )
),
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
5,
Base( 0, 0, 0 ),
Base( 1, 0, 1 ),
Base( 2, 0, 2 ),
Properties( 0, {Marker( "Diamond" ), Fill Color( 0 )} ),
Properties( 1, {Marker( "Triangle" ), Fill Color( 0 )} ),
Properties( 2, {Marker( "Square" ), Fill Color( 0 )} )
)}
),
Dispatch(
{},
"400",
LegendBox,
{Legend Position( {5, [3, 4, 5], 6, [0, 1, 2]} ),
Position( {3, 4, 5, 0, 1, 2} )}
)
)
);
I suggest that you experiment with this kind of change interactively first. Set up a few columns in the Y role as usual. Then right-click in the plot and select Customize. You will get a dialog with a list of the customizable objects, including the current markers. Now select one marker in the list at a time, the click the current marker on the right and select another.
A script could set up Graph Builder and then cycle through each column and change the marker.
BTW, you can use any Unicode character as a marker. Note that markers can only be one character.
Thank you for th reply Mark. In that case, Is there a way to permanently mark the label on the value of the graph?
You didn't mention labels before. Besides the marker (shape), the individual markers may be labeled with the data values in one or more data columns. You designate which columns are to be used as labels. Select the columns with the label data, then select Cols > Label. With the labeling set up, now select all the rows. The selected rows will be labelled in Graph Builder.
I'm sorry that we are taking this one step at a time but your overall goal is not clear.
Sorry for saying my objective earlier. My objective is to make my graph builder markers with data values. Imagine its an array within an array of numbers. I am using the axis of the graphs to show where the are physically located, and the data points should show the value of the die it corresponds to.
If you check the attached picture, The number 274 should represent the highlighted marker.
Can anyone help me with this?
Thank you so much.
The value that you want to use as a label for a marker must be a value in a data column designated to be used as a label. In this example using Big Class data table, the name column is designated as a label column. You must further select all the rows to be labeled and then select Row > Label to apply the labels. In this case, I selected all of the rows. The result in Graph Builder looks like this:
Is this result what you want?
I suggest that you read Help > Books > Essential Graphing for more information and examples.
Thank you so much Mark. That is exactly what I want. By any chance can I position the label to be on top of the point rather than on the side?
One can interactively drag each label to a new position but that solution is not acceptable. The manual repositioning of some labels could be captured in a script and then extended to all the markers, but I have not studied it. I believe that the script would require determining the size of each label in pixels and translating between Cartesian coordinates into pixels.