Yeray,
The problem with TLegendScrollBar was caused by this line from my program. This does modify the Legend Text, but for some reason it affects the scroll bar.
Dest->Legend->Item->Text = Origin->Series->Name;
If I do this instead, the problem is solved. Title overrides Name in the Legend display.
Dest->Series->Title = Origin->Series->Name;
Joe
aligning left axis of multiple charts
-
- Newbie
- Posts: 14
- Joined: Thu Oct 09, 2014 12:00 am
-
- Newbie
- Posts: 14
- Joined: Thu Oct 09, 2014 12:00 am
Re: aligning left axis of multiple charts
Yeray,
The problem with TLegendScrollBar was in how I was setting the Legend text for each Series. This causes a problem. I'm not sure why.
Dest->Legend->Item->Text = Origin->Series->Name;
This fixes the problem:
Origin->Series->Title = Origin->Series->Name; // Title overrides Name
Dest->Series->Title = Origin->Series->Title; // okay to use same Title in multiple charts
Thanks very much.
Joe
The problem with TLegendScrollBar was in how I was setting the Legend text for each Series. This causes a problem. I'm not sure why.
Dest->Legend->Item->Text = Origin->Series->Name;
This fixes the problem:
Origin->Series->Title = Origin->Series->Name; // Title overrides Name
Dest->Series->Title = Origin->Series->Title; // okay to use same Title in multiple charts
Thanks very much.
Joe
Re: aligning left axis of multiple charts
Hi Joe,
http://bugs.teechart.net/show_bug.cgi?id=1041
I've also implemented a fix for the same so it will be available with the next maintenance release.
Then I'm not sure to understand if you are happy with the solutions provided or if you still find problems with this.joepasquariello wrote:I think OnBeforeDrawAxes is better than OnAfterDraw for my purpose. The label widths are known in OnBeforeDrawAxes, and they can be modified before the draw occurs.
Thanks. We'll check that.joepasquariello wrote:Some examples where Help is missing or incomplete are ChartRect (no Help), CloneChart (no description), and TLegendScrollBar (no Help).
joepasquariello wrote:I am trying to use CloneChart() to make a copy of a chart. The two charts will have the same set of series (with different names), but the Series in chart 1 and chart 2 will share the same data from a single TDataSet. Both charts have a Legend (lsSeries) and a TLegendScrollBar. In the first chart, as I move the scroll bar slider up and down, the slider remains the same size, and there are no problems. In the 2nd chart, as I move the slider down, it gets smaller and smaller, until an exception occurs. The problem only occurs if use CloneChart() or CloneChartSeries(). If I create the series for the two charts independently (not cloned), then both TLegendScrollBars work okay. Do you have any idea what I'm doing wrong?
I've been able to reproduce the problem without needing to clone any chart:joepasquariello wrote:The problem with TLegendScrollBar was in how I was setting the Legend text for each Series. This causes a problem. I'm not sure why.This fixes the problem:Code: Select all
Dest->Legend->Item[i]->Text = Origin->Series[i]->Name;
Code: Select all
Origin->Series[i]->Title = Origin->Series[i]->Name; // Title overrides Name Dest->Series[i]->Title = Origin->Series[i]->Title; // okay to use same Title in multiple charts
http://bugs.teechart.net/show_bug.cgi?id=1041
I've also implemented a fix for the same so it will be available with the next maintenance release.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: aligning left axis of multiple charts
Hi Joe,
I see you have the sources. Since the fix is quite simple, you can apply it to your sources. At TeeLegendScrollBar.pas, change the function TLegendScrollBar.TotalCount for this one:Yeray wrote: I've been able to reproduce the problem without needing to clone any chart:
http://bugs.teechart.net/show_bug.cgi?id=1041
I've also implemented a fix for the same so it will be available with the next maintenance release.
Code: Select all
function TLegendScrollBar.TotalCount:Integer;
begin
if HasPaging then
result:=ParentChart.Pages.Count
else
if L.Items.Custom then
result:=L.TotalLegendItems
else
result:=L.TotalLegendItems+L.FirstValue;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: aligning left axis of multiple charts
Hi Joe,
Regarding TLegendScrollBar, I find this in the help:
We are revising the first two: ChartRect and CloneChart.Yeray wrote:Thanks. We'll check that.joepasquariello wrote:Some examples where Help is missing or incomplete are ChartRect (no Help), CloneChart (no description), and TLegendScrollBar (no Help).
Regarding TLegendScrollBar, I find this in the help:
TLegendScrollBar
Hierarchy Properties Methods Events
Unit
TeeLegendScrollBar
Description
Chart Tool used to display an scrollbar inside the Chart Legend.
This scrollbar can be used to scroll among the legend items.
When chart paging is active (Chart1.MaxPointsPerPage property), the scrollbar scrolls page by page instead of point by point.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
-
- Newbie
- Posts: 14
- Joined: Thu Oct 09, 2014 12:00 am
Re: aligning left axis of multiple charts
Hi Yeray,
Thank you for the fix on Legend.Text. Using Series.Title instead is a good work-around for me, so I will probably not apply that patch until I install XE7 Update 1.
Thanks also for looking at the Help. The online Help is more complete. The IDE Help has no Help for TLegendScrollBar. Will the IDE help be brought up to the same level as the Online Help? Since it's all HTML, it could be the same? I hope so, because there is a good search capability in the IDE Help, which is very important. I will try to keep a list of items where Help is missing or could be improved.
Joe
Thank you for the fix on Legend.Text. Using Series.Title instead is a good work-around for me, so I will probably not apply that patch until I install XE7 Update 1.
Thanks also for looking at the Help. The online Help is more complete. The IDE Help has no Help for TLegendScrollBar. Will the IDE help be brought up to the same level as the Online Help? Since it's all HTML, it could be the same? I hope so, because there is a good search capability in the IDE Help, which is very important. I will try to keep a list of items where Help is missing or could be improved.
Joe
Re: aligning left axis of multiple charts
Hi Joe,
We've noted to check these concrete properties when we'll synchronize both helps the for the next maintenance release.joepasquariello wrote:Thanks also for looking at the Help. The online Help is more complete. The IDE Help has no Help for TLegendScrollBar. Will the IDE help be brought up to the same level as the Online Help? Since it's all HTML, it could be the same? I hope so, because there is a good search capability in the IDE Help, which is very important. I will try to keep a list of items where Help is missing or could be improved.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |