Loading a template file creates problems for a tower series.

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
VH1
Advanced
Posts: 105
Joined: Thu May 13, 2004 4:00 am
Location: UK

Loading a template file creates problems for a tower series.

Post by VH1 » Mon Jan 23, 2006 5:36 pm

1.1.2179.21092

This article relates to
http://www.teechart.net/support/viewtopic.php?t=2961
and
http://www.teechart.net/support/viewtopic.php?t=3376

To recreate...

In designer...

Add a teechart to a form.
Add a commander bar and set the chart property.

Run...

Add a tower series
Add a random data source (just select random and apply)

Click a button which does the following operation...

private void button1_Click(object sender, System.EventArgs e)
{

string path = string.Format("{0}\\Charts", Application.StartupPath);

// Determine whether the directory exists.
if(!System.IO.Directory.Exists(path))
{
// Try to create the directory.
System.IO.DirectoryInfo di = System.IO.Directory.CreateDirectory(path);
}


string strChartTemplatePath = Application.StartupPath + @"\Charts\01.Ten";

// Store the existing chart.
System.IO.FileStream fsCreate = null;

if(strChartTemplatePath != null)
{
// Overwrite the existing file
fsCreate = new System.IO.FileStream(strChartTemplatePath,System.IO.FileMode.Create);

this.tChart1.Export.Template.Save(fsCreate);
}

if(fsCreate != null)
{
fsCreate.Close();
}

FileStream fsOpen = null;

if(strChartTemplatePath != null)
{
fsOpen = new System.IO.FileStream(strChartTemplatePath, System.IO.FileMode.Open);

this.tChart1.Import.Template.Load(fsOpen);
}

if(fsOpen != null)
{
fsOpen.Close();
}


this.commander1.Chart = this.tChart1;
}




Conclusion....

A red bar appears as the first XYZ value oon the chart.

Regards,

Vaughan

VH1
Advanced
Posts: 105
Joined: Thu May 13, 2004 4:00 am
Location: UK

Post by VH1 » Tue Jan 24, 2006 9:11 am

I found a workaround for this, but dont understand why I have to do it?

The line...

((Steema.TeeChart.Styles.Series)this.tChart1[0]).ColorEach = false;

is required after loading the file which removes this annoying red tower.

Regards,

Vaughan

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

Post by Narcís » Tue Jan 24, 2006 9:32 am

Hi Vaughan,

I've been able to reproduce this problem here. However, I've checked that this already works using our latest v1 and v2 sources so you can expect this to be fixed for the next maintenance release.
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