I asked this question on how to map a range between 0 and n to 0 to 9.
I use this solution and it works:
private int MapValue(int value, int n)
{
int output = (int)Math.Round((10.0 / (n - 1) * (value - 1)) - 0.5, 0);
if (output == -1) return 0;
else return output;
}
Now I encountered another problem. I one example I have the range 0 to 1116. However most values or between 0 and 50 or maybe 0 and 100. So nevertheless most values are mapped to the same color. How can i avoid that such outliers tamper with my mapping?