Hi,
I have a problem when using the default DataPointColor.Different or DataPointColor.Auto for the charts, it's returning similar colors and I want to somehow set an option so the colors returned for my pie charts, line charts, or bar charts are obviously different.
I'm using InfragisticsSL4 v 10.2.
Any assistance with this would be greatly appreciated.
Cheers,
Canon.
Hello Canon,
Thank you for your post. I have been looking into it and I created a sample project for you with the functionality you want. Basically I copied the default Style of the ColumnChartDataPointTemplate and handled the loaded event of the outer border in its template. In the handler I returned different color for the data points. You can feel free to modify my logic so there are more colors, because currently the code chose from 15. If you want this to work for different series you should copy their default Styles and do the same. The default Styles are located here:
C:\Program Files (x86)\Infragistics\2010.2\SL\DefaultStyles
Please let me know if this helps you or you have further questions on this matter.
Looking forward for your reply.
Thanks for the response and the project, I'll load it and will see if I can make sense of it.
I am looking forward to hear from you.
Hi Stefan,
Unfortunately, I wasn't really able to use your project to solve my problem as I don't think I was clear enough in the description.
I resolved the problem by using the following code in my project:
For i As Integer = 0 To Series.DataPoints.Count - 1
Dim r As Integer = CInt(Math.Ceiling(Rnd() * 255)) Dim g As Integer = CInt(Math.Ceiling(Rnd() * 255)) Dim b As Integer = CInt(Math.Ceiling(Rnd() * 255)) Series.DataPoints(i).Fill = New SolidColorBrush(Color.FromArgb(255, r, g, b))
Next
I'm going to have a list of predefined values rather than random RGB values as listed in my code currently, because when you leave it to the default or DataPointColor.Different, the colors get too similar and it's hard to differentiate between them when you have alot of series added for your chart.
Thanks for your help anyways mate.
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.