Hi Narcis and all Steema Family ..
Very simple trying :
ChangeType any series ...
Then Re-ChangeType same series..
It seems problem is related with a bug in ChangeType Method of Series..
When you run ChangeType method ,the Chart reference of series flies..
The ChangeType method runs like that :
1- All reference of Series move to new fresh series...
2- Calling of Dispose method of Old series..
3- When u dispose old series ,Chart reference flies with old series ...
4- U have got one changed type new series without Chart reference ..
Could you advice us a trick for solve out this problem temprorarly...
Thx for delicious aids..
Series.ChangeType fails when second time triggering...
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi glikoz,
The code below works fine for me here. Can you please test if it work at your end and modify it so that we can reproduce the problem here?
Thanks in advance.
The code below works fine for me here. Can you please test if it work at your end and modify it so that we can reproduce the problem here?
Code: Select all
private void Form1_Load(object sender, System.EventArgs e)
{
Steema.TeeChart.Styles.Series s0=tChart1.Series.Add(typeof(Steema.TeeChart.Styles.Points));
s0.FillSampleValues();
Steema.TeeChart.Styles.Series.ChangeType(ref s0, typeof(Steema.TeeChart.Styles.Line));
}
private void button1_Click(object sender, System.EventArgs e)
{
Steema.TeeChart.Styles.Series s0=tChart1[0];
Steema.TeeChart.Styles.Series.ChangeType(ref s0, typeof(Steema.TeeChart.Styles.Bar));
}
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 |
Hi Narcis ..U can Try this one ..
Code: Select all
public partial class Form1 : Form
{
//public List<CustomPoint> listCustom = new List<CustomPoint>();
public CustomPoint CP;
public Form1()
{
InitializeComponent();
tChart1.Aspect.View3D = false;
}
private void Form1_Load(object sender, System.EventArgs e)
{
Line l = new Line();
//listCustom.Add(l);
CP = l;
Steema.TeeChart.Styles.Series s0 = tChart1.Series.Add(l);
s0.FillSampleValues();
ChangeType(typeof(Steema.TeeChart.Styles.Points));
}
private void button1_Click(object sender, System.EventArgs e)
{
Steema.TeeChart.Styles.Series s0 = tChart1[0];
ChangeType(typeof(Steema.TeeChart.Styles.Area));
ChangeType(typeof(Steema.TeeChart.Styles.Volume));
}
public void ChangeType(Type type)
{
Series s = CP;//listCustom[0] as Series;
Series.ChangeType(ref s, type);
}
}
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi glikoz,
The working for what you are trying to do is:
The working for what you are trying to do is:
Code: Select all
private void Form1_Load(object sender, System.EventArgs e)
{
Line l = new Line();
CustomPoint s0 = tChart1.Series.Add(l) as CustomPoint;
s0.FillSampleValues();
CP = s0;
ChangeType(typeof(Points));
}
private void button1_Click(object sender, System.EventArgs e)
{
CustomPoint s0 = tChart1[0] as CustomPoint;
CP = s0;
ChangeType(typeof(Area));
s0 = tChart1[0] as CustomPoint;
CP = s0;
ChangeType(typeof(Volume));
}
public void ChangeType(Type type)
{
Series s = CP;
Series.ChangeType(ref s, type);
}
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 |