I have the same issue... I have tried to even change the sequence in which data is loaded by the script, modified my data tables in Excel... it seems there is no way for the chart developer on how to change the sequence of the segments of the stacked bar are displayed.
I have played also with the Sorting feature for each dimension, it helped a bit but it never ends up in a logical way...
It seems to me that most likely your problem to sort the bar segments is not as simple, but I think I need to tell you how I solved my sorting issue.
My measures did not have any order. For certain data sets, if I turned off the Auto Sort in the chart, that was enough because they were loaded by the script in order of appearance. But for a certain stacked bar chart that involves a CrossTable feature at load script, this was not working. As I said above, moving around columns in my data set helped a bit but unpredictably. I really needed to make it work, so I added a number to my data set dimensions in front and used the Sorting feature of the chart in Alphabetical order. And it worked just fine.
I went through a lot of scripting try-and-fail, many weeks of that... generated the charts in many different ways, but the simplest of solutions was there a bit hidden and I could not see it from the very beginning.
As I said, this might not be possible for you, but it worked for me.
See this approach using match fonction :
add this in sortorder panel :
match(YourDimension,'<=80%','-80 to 60%','-60 to 80%','-40 to 60%','-20 to 40%','etc','etc' ... )
Hope it helps
You can try using a calculated dimension using the dual function so you can sort the dimension numerically. See attached example.
c232363.qvf 176.0 K
That was an elegant way to solve it!
However, that is not yet my level - I need to study more to understand how you achieved that with only just a few lines...
(BTW, I did not post this question, so I cannot mark it as solved)