Page 1 of 1
Gradient options
Posted: Tue Jan 13, 2009 3:44 pm
by 14045174
It seems to me that in the Dec 19th release non-linear gradient options are broken. At least they both produce the same result, while the previous versions produced distinctively different results.
Posted: Tue Jan 13, 2009 3:56 pm
by narcis
Hi UserLS,
I can't see any difference with 3rd Nov and 19th Dec releases using this code:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
Bar bar1 = new Bar(tChart1.Chart);
bar1.FillSampleValues();
bar1.Gradient.Visible = true;
bar1.Gradient.Style.Visible = true;
bar1.Gradient.Style.Direction = Steema.TeeChart.Drawing.PathGradientMode.FromCenter;
//bar1.Gradient.Style.Direction = Steema.TeeChart.Drawing.PathGradientMode.Radial;
}
Can you please confirm the version in which you noticed the differences and modify the code snippet above so that we can reproduce the problem here?
Thanks in advance.
Posted: Tue Jan 13, 2009 5:26 pm
by 14045174
I do use the Dec 19 version. I did not write any code, just go into chart editor, panel, gradient options. Select direction "from center", set the colors. Now change the direction to "Radial". If you are using middle color - you will see the right behavior. But now go into colors and check "no middle" box. Now both "Radial" and "From Center" will produce exactly the same image.
Posted: Wed Jan 14, 2009 11:34 am
by narcis
Hi UserLS,
Yes, that's correct, radial gradients need at least three colours to work. Try using this code:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
tChart1.Walls.Back.Gradient.StartColor = Color.Red;
tChart1.Walls.Back.Gradient.MiddleColor = Color.White;
tChart1.Walls.Back.Gradient.EndColor = Color.Blue;
tChart1.Walls.Back.Gradient.UseMiddle = true;
tChart1.Walls.Back.Gradient.Style.Visible = true;
tChart1.Walls.Back.Gradient.Style.Direction = Steema.TeeChart.Drawing.PathGradientMode.Radial;
}
I can see a difference here changing Radial to FromCenter. Setting UseMiddle=false there's no difference.