The color of line doesnot change
Posted: Thu Jun 17, 2010 12:38 pm
Hello ,
I am facing a small problem , I am creating lines programmtically and want to have each line different color , but what actullay happening is that all lines have the same color, so can some help me, following is the code.
regrads
Trimble
-----------------------------------------------------------------------------------------------------------
void UpdateChart()
{
tChart1.Series.Clear();
byte color_value=255;
foreach (int i in dic.Keys )
{
byte[] bytes = new byte[4];
Random r = new Random();
r.NextBytes(bytes);
List<Cala> ex = dic.ToList();
Steema.TeeChart.Silverlight.Styles.Line line = new Steema.TeeChart.Silverlight.Styles.Line();
Color color = new Color();
int a = (byte)color_value << 5;
int b = (byte)color_value << 3;
int c = (byte)color_value >> 3;
int d = (byte)color_value >> 2;
color = Color.FromArgb((byte)a,(byte)b,(byte)c,(byte)d);
line.Color = color;
foreach (Cala e in ex)
{
line.Add(e.azi, e.elev);
//series.Add(line);
}
tChart1.Series.Add(line);
}
I am facing a small problem , I am creating lines programmtically and want to have each line different color , but what actullay happening is that all lines have the same color, so can some help me, following is the code.
regrads
Trimble
-----------------------------------------------------------------------------------------------------------
void UpdateChart()
{
tChart1.Series.Clear();
byte color_value=255;
foreach (int i in dic.Keys )
{
byte[] bytes = new byte[4];
Random r = new Random();
r.NextBytes(bytes);
List<Cala> ex = dic.ToList();
Steema.TeeChart.Silverlight.Styles.Line line = new Steema.TeeChart.Silverlight.Styles.Line();
Color color = new Color();
int a = (byte)color_value << 5;
int b = (byte)color_value << 3;
int c = (byte)color_value >> 3;
int d = (byte)color_value >> 2;
color = Color.FromArgb((byte)a,(byte)b,(byte)c,(byte)d);
line.Color = color;
foreach (Cala e in ex)
{
line.Add(e.azi, e.elev);
//series.Add(line);
}
tChart1.Series.Add(line);
}