AreaSeries - load from template

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
UserLS
Advanced
Posts: 247
Joined: Wed May 23, 2007 12:00 am

AreaSeries - load from template

Post by UserLS » Wed Nov 05, 2008 7:14 pm

When I save area series into a template and then load it, border lines and area lines are not fully restored (they lose their colors). Same is true for some other pen objects (like lines in the LinePoints series).

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Nov 06, 2008 9:44 am

Hi Profitstar,

Code below works fine for me here using latest TeeChart for .NET v3 release available at the client area. Can you please test if it works fine for you and, if necessary, modify it so that we can reproduce the issue here?

Code: Select all

		public Form1()
		{
			InitializeComponent();
			InitializeChart();
		}

		private System.IO.MemoryStream stream;

		private void InitializeChart()
		{
			tChart1.Aspect.View3D = false;

			Steema.TeeChart.Styles.Area area1 = new Steema.TeeChart.Styles.Area(tChart1.Chart);
			area1.FillSampleValues();
			area1.AreaLines.Color = Color.Red;
			area1.LinePen.Color = Color.Lime;

			Steema.TeeChart.Styles.LinePoint linePoint1 = new Steema.TeeChart.Styles.LinePoint(tChart1.Chart);
			linePoint1.FillSampleValues();
			linePoint1.LinePen.Color = Color.Blue;
			linePoint1.LinePen.Style = System.Drawing.Drawing2D.DashStyle.Dash;

			stream = new System.IO.MemoryStream();
			tChart1.Export.Template.Save(stream);	
		}

		private void button1_Click(object sender, EventArgs e)
		{			
			stream.Position = 0;

			tChart1.Clear();
			tChart1.Import.Template.Load(stream);
		}
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
Image Image Image Image Image Image
Instructions - How to post in this forum

UserLS
Advanced
Posts: 247
Joined: Wed May 23, 2007 12:00 am

Post by UserLS » Mon Nov 10, 2008 3:25 pm

Try this code - it produces 2 different looking graphs:

Code: Select all

    public Form1()
    {
      InitializeComponent();
      InitializeChart();
    }

    private MemoryStream stream;

    private void InitializeChart()
    {
      TChart chart = new TChart();

      Area area = new Area(chart.Chart);
      area.Color = Color.DarkMagenta;
      area.AreaLines.Color = Color.YellowGreen;
      area.AreaLines.Visible = true;
      area.AreaLines.Width = 2;
      area.LinePen.Color = Color.YellowGreen;
      area.LinePen.Visible = true;
      area.LinePen.Width = 2;
      area.FillSampleValues();

      stream = new System.IO.MemoryStream();
      chart.Export.Template.Save(stream);
    }

    private void button1_Click(object sender, EventArgs e)
    {
      stream.Position = 0;

      tChart1.Clear();
      tChart1.Import.Template.Load(stream);
    } 

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Nov 10, 2008 4:09 pm

Hi Profitstar,

Thanks for the code. I could reproduce the issue here now and added it (TF02013556) to the defect list to be fixed for next releases.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply