Jump to content

How to sort scatter plot based on column value


YINGDE ZHU

Recommended Posts

Is there anyway to change the x-axis value order in scatter plot without creatinghierachy

It seems scatter plot automatically draw dots in an alphabeta order.

I also tried ironpython to set a custom sort order based on these two posts:

https://community.spotfire.com/wiki/use-ironpython-set-custom-sort-order-ti...

https://community.spotfire.com/wiki/ironpython-script-set-custom-sort-order

However, everytime I run the ironpython script, nothing happened. The visualized table is stall in same order and the scatter plost did not change either.

I don't know how to continue, please help.

I attached code, original data sheet and screenshot here.

Link to comment
Share on other sites

Sorry, I can't open the file due to a different Spotfire version. But if you want to be able to sort the x-axis by the y-value you should use a bar chart.

 

A possible workaround for your scatter plot is to put an additional rank on the axis. So first put Rank([y.col]) and make the axis categorical, then add your [x.col]. On the y-axis you keep [y.col]

 

You can see here that my axis is sorted by the rank, not by the date time.

 

rank.png

Link to comment
Share on other sites

If this helps. There is no direct way to sort X axis based on Y axis in Scatter Plot.

 

You may want to use the following custom expression on X axis as a workaround.

 

 

 

See if this article also helps you

https://support.tibco.com/s/article/How-to-set-the-order-in-which-markers-are-rendered-in-a-Scatter-Plot

Go to Data >> Column properties >> Sort Order If the custom sort options helps you.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...