Wrong color is shown in the legend
Wrong color is shown in the legend
Hi ,
I have a problem -when some of my series are not active and I set the legend CheckBoxes property to be false.
In this case the colors of the legends are wrong.
Steps:
1.This is my chart : 2.I change some of the series to be not active : 3.I chnge the property of the legend to be CheckBoxes = false : Please advice .
Thanks
I have a problem -when some of my series are not active and I set the legend CheckBoxes property to be false.
In this case the colors of the legends are wrong.
Steps:
1.This is my chart : 2.I change some of the series to be not active : 3.I chnge the property of the legend to be CheckBoxes = false : Please advice .
Thanks
Re: Wrong color is shown in the legend
Hello gcrnd,
I couldn't reproduce your problem using next simple code:
Please, modify previous code because we can reproduce your problem exactly here.
Thanks,
I couldn't reproduce your problem using next simple code:
Code: Select all
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
for (int i = 0; i < 6; i++)
{
new Steema.TeeChart.Styles.Line(tChart1.Chart);
tChart1[i].FillSampleValues();
tChart1[i].XValues.DateTime = true;
}
tChart1.Legend.CheckBoxes = true;
}
Thanks,
Best Regards,
Sandra Pazos / 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 |
Re: Wrong color is shown in the legend
Hi qcrnd,
I've reproduced the problem hiding some series and hiding the checkboxes so I've added it to the defect list to be fixed in future releases (TF02014918):
I've reproduced the problem hiding some series and hiding the checkboxes so I've added it to the defect list to be fixed in future releases (TF02014918):
Code: Select all
tChart1.Aspect.View3D = false;
for (int i = 0; i < 3; i++)
{
new Steema.TeeChart.Styles.Line(tChart1.Chart);
tChart1[i].FillSampleValues();
}
tChart1.Legend.CheckBoxes = true;
tChart1[0].Active = false;
tChart1.Draw();
tChart1.Legend.CheckBoxes = false;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Wrong color is shown in the legend
Do you have any workaround that I can use until we get the fix in future versions?
Thanks
Thanks
Re: Wrong color is shown in the legend
Hello gcrnd,
I have found a workaround using GetLengeText Event and it works fine here with last version of TeeChart .Net. Please, could you check if next code works as you want?
I hope will helps.
Thanks,
I have found a workaround using GetLengeText Event and it works fine here with last version of TeeChart .Net. Please, could you check if next code works as you want?
Code: Select all
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
for (int i = 0; i < 3; i++)
{
new Steema.TeeChart.Styles.Line(tChart1.Chart);
tChart1[i].FillSampleValues();
}
tChart1.Legend.CheckBoxes = true;
tChart1[0].Active = false;
tChart1.Draw();
tChart1.Legend.CheckBoxes = false;
tChart1.GetLegendText += new Steema.TeeChart.GetLegendTextEventHandler(tChart1_GetLegendText);
}
void tChart1_GetLegendText(object sender, Steema.TeeChart.GetLegendTextEventArgs e)
{
foreach (Steema.TeeChart.Styles.Line s in tChart1.Series)
{
if (s.Active)
{
if (e.Text == s.Title)
{
tChart1.Legend.Items[e.Index].Text = s.Title;
}
}
}
Thanks,
Best Regards,
Sandra Pazos / 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 |
Re: Wrong color is shown in the legend
Hi ,
I tried to use the workaround , but it delete the legend and the colors in the chart.
When the checkboxes = true I see : When the checkboxes = false I see : I want to see the legend text and the legend color
Please advice.
Thanks
I tried to use the workaround , but it delete the legend and the colors in the chart.
When the checkboxes = true I see : When the checkboxes = false I see : I want to see the legend text and the legend color
Please advice.
Thanks
Re: Wrong color is shown in the legend
Hello gcrnd,
I couldn't reproduce your problem here using last version of TeeChart.Net. Please, could you send us a simple project, because we can see the problem here? Also, could you say what version of TeeChart .Net you are using?
Thanks,
I couldn't reproduce your problem here using last version of TeeChart.Net. Please, could you send us a simple project, because we can see the problem here? Also, could you say what version of TeeChart .Net you are using?
Thanks,
Best Regards,
Sandra Pazos / 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 |
Re: Wrong color is shown in the legend
Hi Sandra ,
My version is 3.5.3425.20244
I tried to create a small example - and it seems to work partially - since on resize of the chart - the legend begins to be corrupted.
I tried to add the event and the method to our code ,and the legend looks corrupted , like the images that i send you - I think that this is related to size of the chart .
I also tried to compare between the legend properties of the example and the chart in my code - and all properties were the same.
Could you please explain to me what exactly the event "GetLegendText" and the method "ChartGetLegendText" supposed to do ? This may help us to understand why it is not working properly :
private void ChartGetLegendText(object sender, GetLegendTextEventArgs e)
{
foreach (Series series in Chart.Series)
{
if (series.Active)
{
if (e.Text == series.Title)
{
Chart.Legend.Items[e.Index].Text = series.Title;
}
}
}
Thanks
Kety
My version is 3.5.3425.20244
I tried to create a small example - and it seems to work partially - since on resize of the chart - the legend begins to be corrupted.
I tried to add the event and the method to our code ,and the legend looks corrupted , like the images that i send you - I think that this is related to size of the chart .
I also tried to compare between the legend properties of the example and the chart in my code - and all properties were the same.
Could you please explain to me what exactly the event "GetLegendText" and the method "ChartGetLegendText" supposed to do ? This may help us to understand why it is not working properly :
private void ChartGetLegendText(object sender, GetLegendTextEventArgs e)
{
foreach (Series series in Chart.Series)
{
if (series.Active)
{
if (e.Text == series.Title)
{
Chart.Legend.Items[e.Index].Text = series.Title;
}
}
}
Thanks
Kety
Re: Wrong color is shown in the legend
Hello Kety,
On the other hand, I recommend that update last version 3.5.3700.30574/5 you could download it in this link and check if it works as you want. Also, I have checked previous code with last version 4 of TeeChart .Net and works fine.
I hope will helps.
Thanks,
GetLegenText is event that you can use basically to change text for each items of legend. I have made other example, because I found that my previous code doesn't work correctly for each case. Please, check next example works as you want.Could you please explain to me what exactly the event "GetLegendText" and the method "ChartGetLegendText" supposed to do? This may help us to understand why it is not working properly:
Code: Select all
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
for (int i = 0; i < 6; i++)
{
new Steema.TeeChart.Styles.Line(tChart1.Chart);
tChart1[i].FillSampleValues();
}
tChart1.Draw();
tChart1.GetLegendText += new Steema.TeeChart.GetLegendTextEventHandler(tChart1_GetLegendText);
tChart1.Draw();
}
void tChart1_GetLegendText(object sender, Steema.TeeChart.GetLegendTextEventArgs e)
{
foreach (Steema.TeeChart.Styles.Line s in tChart1.Series)
{
if (s.Active)
{
if (e.Text == s.Title)
{
tChart1.Legend.Items[e.Index].Text = s.Title;
}
}
else if (!s.Active && tChart1.Legend.CheckBoxes)
{
if (e.Text == s.Title)
{
tChart1.Legend.Items[e.Index].Text = s.Title;
}
}
}
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
tChart1.Legend.CheckBoxes = checkBox1.Checked;
}
I hope will helps.
Thanks,
Best Regards,
Sandra Pazos / 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 |
Re: Wrong color is shown in the legend
hi sandrs,
I can not upgrade my version we are a week before code freeze.
I used you example without the method :
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
tChart1.Legend.CheckBoxes = checkBox1.Checked;
}
Since I didn't know to which event to link it.
And I still have the same problem - I see only the checkboxes without the label.
Please advice.
I can not upgrade my version we are a week before code freeze.
I used you example without the method :
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
tChart1.Legend.CheckBoxes = checkBox1.Checked;
}
Since I didn't know to which event to link it.
And I still have the same problem - I see only the checkboxes without the label.
Please advice.
Re: Wrong color is shown in the legend
Hello gcrnd,
Finally, I could reproduce your problem, and I have added it in bug report list [TF02014931]. We will try to fix it for next maintenence releases of TeeChart .Net.
Thanks,
Finally, I could reproduce your problem, and I have added it in bug report list [TF02014931]. We will try to fix it for next maintenence releases of TeeChart .Net.
Thanks,
Best Regards,
Sandra Pazos / 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 |
Re: Wrong color is shown in the legend
Hi Sandra,
So , I return to me previous request ...
Do you have any workaround that I can use until the fix in the future versions ?
Thanks
Kety
So , I return to me previous request ...
Do you have any workaround that I can use until the fix in the future versions ?
Thanks
Kety
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Wrong color is shown in the legend
Hello Kety,
Sandra already suggested a workaround which involved using latest TeeChart for .NET v3 build available. If you can't update your TeeChart version the only solution I can think of is drawing your own custom legend as in the example Christopher Ireland posted on this thread.
Sandra already suggested a workaround which involved using latest TeeChart for .NET v3 build available. If you can't update your TeeChart version the only solution I can think of is drawing your own custom legend as in the example Christopher Ireland posted on this thread.
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 |
Re: Wrong color is shown in the legend
Hi ,
I didn't understand you answer my version is 3.5 - newer than v3, and the workaround that she gave me didn't work also in the example,since she was able to reproduce the problem also...
I didn't understand you answer my version is 3.5 - newer than v3, and the workaround that she gave me didn't work also in the example,since she was able to reproduce the problem also...
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Wrong color is shown in the legend
Hello,
I'm sorry if I didn't explain myself clearly enough. As you can see here, build 3.5.3700.30574/5 is the latest version available of TeeChart for .NET v3. A TeeChart for .NET v3.5 doesn't exist, version following up TeeChart for .NET v3 is TeeChart for .NET v2010.I didn't understand you answer my version is 3.5 - newer than v3,
In that case the only solution I can think of is using drawing your own legend as I told in my previous reply.and the workaround that she gave me didn't work also in the example,since she was able to reproduce the problem also...
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 |