- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
How to revere order in axis of graph builder in JSL ?
Hello,
I am creating a heatmap with Graph builder.
I try to find a way to reverse the order of the axis by scripting but I cannot (although in the GUI, it is straight forward).
Please see script attached.
What I have so far is:
And I want it to be:
Thanks a lot.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to revere order in axis of graph builder in JSL ?
Send the message directly to the Axisbox.
gb = Graph Builder(Variables(X(:Column), Y(:Row), Color(:Value)), Elements(Heatmap(X, Y, Legend(7))));
Report(gb)[Axisbox(1)] << {Min(0), Max(9), Inc(1)};
Report(gb)[Axisbox(2)] << {Min(0), Max(15), Inc(1), reversed scale};
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to revere order in axis of graph builder in JSL ?
Send the message directly to the Axisbox.
gb = Graph Builder(Variables(X(:Column), Y(:Row), Color(:Value)), Elements(Heatmap(X, Y, Legend(7))));
Report(gb)[Axisbox(1)] << {Min(0), Max(9), Inc(1)};
Report(gb)[Axisbox(2)] << {Min(0), Max(15), Inc(1), reversed scale};
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to revere order in axis of graph builder in JSL ?
Magic ! it works !
Do you know to which object I can send a message to change the gradient Label levels and properties ?
{Label Levels( [620 640 660 680 700 725 750 775 800] ),
Reverse Gradient( 1 )}
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to revere order in axis of graph builder in JSL ?
Hi, you can do this:
gb<<SendToReport(
Dispatch({},
"400",
ScaleBox,
{Legend Model(
1,
Properties(
0,
{gradient(
{Label Levels( [620 640 660 680 700 725 750 775 800] ),
Reverse Gradient( 1 ) }
)}
)
)}
)
);
Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to revere order in axis of graph builder in JSL ?
That seems to be more intricate. I would copy portions of the generated code from a manually designed graph.
This should work:
gb << Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
5,
Properties(
0,
{gradient({Scale Values([620 640 660 680 700 725 750 775 800]), Reverse Labels(1)})}
)
)}
);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to revere order in axis of graph builder in JSL ?
That's what I do so far, but it is not very elegant .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to revere order in axis of graph builder in JSL ?
Well, to be consistent with the solution MS gave you about AxisBox, it should be something like:
Report(gb)[legend box(1)]<< {Label Levels( [620 640 660 680 700 725 750 775 800] ), Reverse Gradient( 1 ) }
but it doesn't work, and if you run
show properties(Report(gb)[legend box(1)])
you'll see that you have far less possibilities compared to
show properties(Report(gb)[axis box(1)])
Sorry I can't help more...