Page 1 of 1
Tag lost changing serie type
Posted: Mon Mar 22, 2010 11:35 am
by 15654539
When I change with the chartEditor the type of a serie (for example from line to points) I keep all the values of the serie but not the tag. Is correct this behaviour?
Thanks
Re: Tag lost changing serie type
Posted: Tue Mar 23, 2010 4:46 pm
by yeray
Hi wakeup,
Yes, actually this isn't copied to the new series. I've added this to the wish list to be implemented in future releases (TF02014745)
Re: Tag lost changing serie type
Posted: Wed Mar 24, 2010 8:21 am
by 15654539
Ok thanks.
Is there any other serie property which it is diferent between series and it can't be changed from chart editor?
I need to identify if the user has changed the order of the series when he use the chart editor... and I think there isn't any evento to detect it.
thanks!
Re: Tag lost changing serie type
Posted: Thu Mar 25, 2010 11:48 am
by yeray
Hi wakeup,
I've investigated this further and I've seen that the problem was that the tag property wasn't assigned at Series' method AssignFormat(Series source, Series target).
Correcting it I can change the series type and the tag is maintained so the following example seems to work fine:
Code: Select all
private void InitializeChart()
{
chartController1.Chart = tChart1;
tChart1.Aspect.View3D = false;
for (int i = 0; i < 4; i++)
{
new Steema.TeeChart.Styles.Area(tChart1.Chart);
tChart1[i].FillSampleValues();
tChart1[i].Tag = "series " + i;
}
}
private void button1_Click(object sender, EventArgs e)
{
string[] tmpTag = new string[tChart1.Series.Count];
for (int i = 0; i < tChart1.Series.Count; i++)
{
tmpTag[i] = tChart1[i].Tag.ToString();
}
Steema.TeeChart.Editor editor1 = new Steema.TeeChart.Editor(tChart1);
editor1.ShowModal();
bool changed = false;
for (int i = 0; i < tChart1.Series.Count; i++)
{
if (tmpTag[i] != tChart1[i].Tag.ToString()) changed = true;
}
if (changed) MessageBox.Show("the order has changed");
}
So I'll close the ticket with number (TF02014745). Note that this enhancement will be available with the next maintenance release.
Re: Tag lost changing serie type
Posted: Thu Mar 25, 2010 3:10 pm
by 15654539
I think you don't understand me well. Sorry about my bad english.
If you run your code and change the type of your serie from area to Point (by example) you will get an error because tag is null in the changed serie.
If you change the type in two series and you change the order you can't identify in the code if the order has been changed or not.
I need any property in the serie, which can't be changed by the user, and It is not removed if the user change the type of the serie.
Thanks
Re: Tag lost changing serie type
Posted: Thu Mar 25, 2010 5:06 pm
by yeray
Hi wakeup,
No, excuse me. I think it was me who haven't explained well.
The code above doesn't work right now but will work with the changes I've made to TeeChart sources.
I'm afraid that, until the next maintenance release isn't published, I can't think on a way to do what you want.
Re: Tag lost changing serie type
Posted: Thu Mar 25, 2010 5:14 pm
by 15654539
Ok, if it is solved in the next release I can wait.
Thanks!