Page 1 of 1
Series name issue display in legend
Posted: Tue Mar 26, 2013 7:57 am
by 9641422
Hi,
I am facing problem with series name in legend. There are 60+ series in my chart. There are two problems:
• All series are not shown in legend.
• Wrong legends are being displayed. The names shown in the legend are jumbled. Correct names are however seen in TeeChart editor.
During diagnosis, I have found that if my chart has up to 20 series then there is no problem in displaying series name in legend, but if series is more than 20 then name displayed in legend become wrong.
For the first problem, as per my understanding we can use legend scroll bar tool. However, it is resulting in crash when scrolling.
Is there a limitation on number of series, for which legend displays correctly?
Any solution for this would be highly appreciated.
Thanks in advance.
Regards,
Amol
Re: Series name issue display in legend
Posted: Wed Mar 27, 2013 12:23 pm
by yeray
Hi Amol,
Amol wrote:• All series are not shown in legend.
Have you tried using the LegendScrollBar tool?
Amol wrote:• Wrong legends are being displayed. The names shown in the legend are jumbled. Correct names are however seen in TeeChart editor.
During diagnosis, I have found that if my chart has up to 20 series then there is no problem in displaying series name in legend, but if series is more than 20 then name displayed in legend become wrong.
For the first problem, as per my understanding we can use legend scroll bar tool. However, it is resulting in crash when scrolling.
Is there a limitation on number of series, for which legend displays correctly?
I'm trying to reproduce this with the code below but I see the correct texts in the legend.
Could you please modify the code so we can reproduce the problem here?
Code: Select all
Private Sub Form_Load()
TeeCommander1.ChartLink = TChart1.ChartLink
TChart1.Aspect.View3D = False
Dim i As Integer
For i = 0 To 60
TChart1.AddSeries scFastLine
TChart1.Series(i).FillSampleValues
TChart1.Series(i).Title = "My Series " + Str$(i)
Next i
TChart1.Tools.Add tcLegendScrollBar
End Sub
Thanks in advance.
Re: Series name issue display in legend
Posted: Tue Apr 02, 2013 10:28 am
by 9641422
Hi Yeray,
Thanks for your comments.
You are right; the code snippet that you have given doesn’t give problem. On further diagnosis we noticed that the legend names in your example are relatively smaller, while the ones that we are using are slightly bigger. If we use bigger legend names due to which all legends don’t come in legend display area, then legend jumbling occurs. If we use legend scroll bar tool, then all legends appear but jumbling still exists and also on scrolling it results in a crash. Please note that we have to keep the legend at bottom as this is part of our requirement.
For your reference we are uploading a sample project written in VC++ using TeeChart ActiveX Pro v 7.
Thanks & Regards
Amol
Re: Series name issue display in legend
Posted: Thu Apr 04, 2013 4:14 pm
by yeray
Hello,
The project you have attached give me problems when trying to execute it.
However, I've translated the relevant code from it to VB6 and it seems to work fine for me here:
Code: Select all
TChart1.RemoveAllSeries
TChart1.Aspect.View3D = False
Dim seriesctr, datactr As Integer
For seriesctr = 0 To 60 - 1
TChart1.AddSeries scLine
For datactr = 2 To 1000 - 1
TChart1.Series(seriesctr).AddXY datactr, datactr + datactr, "", clTeeColor
Next datactr
TChart1.Series(seriesctr).Title = "my Series but this should be correct" + Str$(seriesctr)
TChart1.Series(seriesctr).Active = True
Next seriesctr
TChart1.Tools.Add tcLegendScrollBar
TChart1.Legend.Alignment = laBottom
TChart1.Legend.Symbol.Width = 5
TChart1.Legend.CheckBoxes = True
This is what I get when I run the VB6 application above with TeeChart 7.0.1.6:
- Test.png (21.96 KiB) Viewed 10603 times
That looks correct to me. Isn't it?
However, if I use the legend scrollbar, I get the following error:
Access violation at address 06754838 in module 'TeeChart7.ocx'. Read of address 00000030.
Is this the error you are also finding?
I can't reproduce the error with the actual TeeChart version. Have you tried it?