- Create a bar series, do not change its color, go to pattern editor, make gradient visible and make sure gradient colors are different from the series color. Save to a template file and then load this template back. The gradient colors should be correct, but if you had a horizontal bar graph with vertical gradient direction - too bad, the direction is horizontal now.
- Create a bar series, this time change its color, go to pattern editor, make gradient visible and make sure gradient colors are different from the series color. Save to a template file and then load this template back. The gradient colors now are using series color and the middle color (if was used) isn't used anymore. Half of the time, if I go to the pattern editor it will show the correct colors for gradient option, but if I did not go into each of them and reselect the same color - next time it will show the defaults for the selected series color.
Saving bar series to templates
Saving bar series to templates
There are two different cases (both can be reproduced for both vertical and horizontal bars with very little difference):
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi UserLS,
Does this produce the problem at your end? Can you modify the code or post exact steps we should follow so that we can reproduce the issue here?
Thanks in advance.
I'm not sure to understand which the exact problem is. I can't reproduce it at designtime. I tried to reproduce it using code below and I think it works fine:# Create a bar series, do not change its color, go to pattern editor, make gradient visible and make sure gradient colors are different from the series color. Save to a template file and then load this template back. The gradient colors should be correct, but if you had a horizontal bar graph with vertical gradient direction - too bad, the direction is horizontal now.
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
Steema.TeeChart.Styles.Bar bar1 = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
bar1.FillSampleValues();
bar1.Gradient.Visible = true;
bar1.Gradient.StartColor = Color.Red;
bar1.Gradient.EndColor = Color.Yellow;
System.IO.MemoryStream stream = new System.IO.MemoryStream();
tChart1.Export.Template.Save(stream);
tChart1.Clear();
Steema.TeeChart.Styles.HorizBar horizBar1 = new Steema.TeeChart.Styles.HorizBar(tChart1.Chart);
horizBar1.FillSampleValues();
horizBar1.Gradient.Visible = true;
horizBar1.Gradient.Direction = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
stream.Position = 0;
tChart1.Import.Template.Load(stream);
}
I couldn't reproduce this one either. Could you please let us know how to reproduce it too? You may also want to check if latest release solves both problems at your end.# Create a bar series, this time change its color, go to pattern editor, make gradient visible and make sure gradient colors are different from the series color. Save to a template file and then load this template back. The gradient colors now are using series color and the middle color (if was used) isn't used anymore. Half of the time, if I go to the pattern editor it will show the correct colors for gradient option, but if I did not go into each of them and reselect the same color - next time it will show the defaults for the selected series color.
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
oops... You still have a slight problem here: if you run the following code the gradient colors are there! but the direction will be switched to horizontal.
Code: Select all
private void testButton_Click(object sender, System.EventArgs e)
{
tChart1.Clear();
var bar = new HorizBar(tChart1.Chart)
{
Color = Color.Yellow,
Gradient =
{
Direction = LinearGradientMode.Vertical,
Visible = true,
StartColor = Color.Red,
EndColor = Color.Green,
MiddleColor = Color.DeepPink
}
};
bar.FillSampleValues();
using (var stream = new System.IO.MemoryStream())
{
tChart1.Export.Template.Save(stream);
tChart1.Clear();
stream.Position = 0;
tChart1.Import.Template.Load(stream);
}
}
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi UserLS,
Yes, I could reproduce that one and added it (TF02013698) to the list to be fixed.
Yes, I could reproduce that one and added it (TF02013698) to the list to be fixed.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |