Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
170
How to keep same values same color in 3d UltraBarChart
posted

I am creating a Dashboard showing results by user in a 3D UltraBarChart. The call to stored procedure brings back 9 rows of data. Those nine rows become the bars in chart. Of the 9 results 7 are 1 person and 2 are the other. I would like for the 7 of first person be all the same color and the other two a different color.

Attached is picture of barchart as it currently is displaying.  

Trying to make all Paul lets say Red and Erin Green

Thanks for any help. Most appreciated.

Tp,

  • 34810
    Offline posted

    Hello Tom,

    I have been investigating into a way to achieve your requirement in this case, and I would recommend utilizing the UltraChart.ColorModel.CustomPalette property of the chart to achieve this. This property takes a Color[] and the indices of the colors in that array will be assigned to the bar representing the data item at that index in your underlying data source. For example, if the Color at index 2 is green, then the bar representing your data item at index 2 in your data source will be painted green.

    Knowing this, in order to make all Paul bars red and all Erin bars green, you will need to loop through your data source and construct a Color[] with the same length as your data source, assigning each index based on the value of the name for the data item.

    Please let me know if you have any other questions or concerns on this matter.