Ive this function:
I use this function here:
So for every entry in DB, I thought there will be an other color.
But, in practice, every entry has the same color
How can I fix this?
C#:
public static Color GetRandomColor()
{
Random random = new Random();
return Color.FromArgb(random.Next(256), random.Next(256), random.Next(256));
}
I use this function here:
C#:
int[] values;
string[] legends;
Color[] colors;
values = new int[10];
legends = new string[10];
colors = new Color[10];
int i = 0;
while(reader.Read())
{
values[i] = Convert.ToInt32(reader.GetValue(reader.GetOrdinal("total_played")));
legends[i] = reader.GetValue(reader.GetOrdinal("history_artist")) + " - " + reader.GetValue(reader.GetOrdinal("history_title"));
colors[i] = ChartUtil.GetRandomColor();
i += 1;
}
So for every entry in DB, I thought there will be an other color.
But, in practice, every entry has the same color
How can I fix this?