The data categories should be ordered within each bar in the same sequence, with the least variable categories displayed at the bottom and the most variable at the top.
Additional Information:
Sometimes there are independent logical grounds for the ordering of data categories. If a segmented bar graph that is constructed on a logical basis produces confusing irregularity of segments, then it might be better to display the data in some other graphic format. Any irregularity in the bottom segment will 'propagate' throughout the segments above it, which will make it difficult for a user to examine irregularities in the upper segments.