cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
samir
Level IV

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:

11865_pastedImage_0.png

And I want it to be:

11866_pastedImage_1.png

Thanks a lot.

1 ACCEPTED SOLUTION

Accepted Solutions
ms
Super User (Alumni) ms
Super User (Alumni)

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};

View solution in original post

6 REPLIES 6
ms
Super User (Alumni) ms
Super User (Alumni)

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};

samir
Level IV

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

heloiseheraud
Level II

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

ms
Super User (Alumni) ms
Super User (Alumni)

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)})}

        )

    )}

);

samir
Level IV

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 .

heloiseheraud
Level II

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...