add Maximum Colors in color pallete dynamically

Hello,

I am looking for to add maximum unique colors for data bars which has unique values.
is there any limitations of colors?
As shown in below snapshot, blue color started repeating although it is different series item (unique one).
While configuration, I have selected maximum date parameter and other filter parameters. Still it is repeating blue palate although those series items are not same.

Regards,
Prashant

Hi @prashant,

You can add as many colours to the chart’s Data Point Palette as you like and it will simply use those colours, in order, for each series that is drawn. If you have more series than colours in this collection, it loops around and reuses the colours.

Your choices:

  1. Add more colours to this collection

  2. Do something else - why do you need so many unique series colours on your chart? It will get to the point where people can’t differentiate the differences between all the colours because you have some many.

  3. Colour your chart based on data. You can use colour rules to define an TO and FROM colour making everything unique. (until you run out of different colours in the range)

    https://www.dundas.com/support/learning/documentation/data-visualizations/how-to/apply-colors-to-data-points-or-series-using-color-rules

1 Like

Thnx Jeff. I will check on it.

@Jeff,
I tried AUTO COLOR RULE with Number of Classes=9999 (expecting those many colors will be created). however I got maximum 4 distinct colors. When I tried Number of Classes=5, then I got max 4 colors only. Please find below screenshot for your reference. As a business requirement, I am expecting atleast 200 distinct colors to be added automatically.

Hi Prashant,

I’m not sure why changing the number of classes isn’t having an effect, i would expect it to but maybe i’m missing something.

Why don’t you try setting these via script? Since you want so many colours you might as well just randomize them.

function getRandomColor() {
var letters = ‘0123456789ABCDEF’;
var color = ‘#’;
for (var i = 0; i < 6; i++) {
color += letters[Math.floor(Math.random() * 16)];
}
return color;
}

var points = chart1.control.series[0].getPoints();
points.forEach(function(point) {
point.fill = new dundas.controls.SolidColorBrush(getRandomColor());
});

Hello Jeff,
I tried above script. Although I changed i<100, it is not giving me different colors, it shows hollow rectangles. IfI keep it same as above i.e. i<6, it gives me 6 random color which is same as AUTO COLOR RULE setting of max 6 colors for number of classes although I make number of classes=100, it show 6 different colors only.
Can your team look into this?
Appreciate.

Regards,
Prashant

Absolutely, i’ll have someone reach out to assist.

Hi Prashant,

I’d be more than happy to assist you with this issue and it would be great if we could exchange emails. Once the issue is resolved, I will post the solution here.

However, I could not find your email address in our Sugar system. Can you please send a test email to Support inbox (support@dundas.com)?

Thank you!