title: Why are the colors correct but not the labels in the legend on Dojo StackedColumn
body: <p>I have an issue with the Legend on a StackedColumn chart. I have set the following dataSeries and legend elements. </p>
  
  <p><img src="https://i.stack.imgur.com/sShvX.png" alt="enter image description here"></p>
  
  <p>In the code, I have the following for loop to assign all the labels to the values so that they appear in the legend.</p>
  
  <pre><code>v = compositeData.dataSeries;
  y = compositeData.legend;
  for (i = 0; i &lt; v.length; i++) {
      dataSeries = v[i];
      r += '  ynchart.addSeries("'+y[i]+'", ['+dataSeries+']);'+@NewLine();
  }
  </code></pre>
  
  <p>When I run the code, I end up with </p>
  
  <p><img src="https://i.stack.imgur.com/zXBco.png" alt="enter image description here"></p>
  
  <p>showing the legend except the order of the labels is not in the order I expected. Element  [3] is first, followed by [0], <a href="https://i.stack.imgur.com/sShvX.png" rel="nofollow noreferrer">1</a> and <a href="https://i.stack.imgur.com/zXBco.png" rel="nofollow noreferrer">2</a>. The color of the elements in the legend are in the correct order but somehow the label is not. I have no code in the script anywhere else that sorts anything. Why is the order of the legend label reordering itself and how do I fix it?</p>