Extra legend tool
Extra legend tool
Hi,
How is it possible to add a custom symbol in an Extra legend tool ?
I use LegendStyle := lsGroups and i would like to draw a colored square between the check box and the text of the group name.
I didn't find when the Symbol.OnDraw event is fired.
Best regards
How is it possible to add a custom symbol in an Extra legend tool ?
I use LegendStyle := lsGroups and i would like to draw a colored square between the check box and the text of the group name.
I didn't find when the Symbol.OnDraw event is fired.
Best regards
Hi stsl,
Yes, I'm afraid that there is no event for customizing the ExtraLegendTool symbol. But you always can draw custom rectangles directly to the canvas at OnAfterDraw event or where you are customizing your tool.
Yes, I'm afraid that there is no event for customizing the ExtraLegendTool symbol. But you always can draw custom rectangles directly to the canvas at OnAfterDraw event or where you are customizing your tool.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Your are wrong, it's also possible to add rectangle in an extralegend but only when we are in lsSeries mode.
Please, this behaviour is very important for me and (and very urgent) and i have no time to find a workaround for this bug (for me, it's a bug,
and when i use TeeChart, i spend 60% of my time to bypass bugs and strange things).
Please, this behaviour is very important for me and (and very urgent) and i have no time to find a workaround for this bug (for me, it's a bug,
and when i use TeeChart, i spend 60% of my time to bypass bugs and strange things).
Hi stsl,
Excuse me if I haven't been enough clear. I meant that the event OnDraw for symbol legend only seems to work for the normal legend, not for this tool. And I've added it to the wish list to be fixed asap (TV52014060).
So, for the normal legend it would be easy to draw the custom symbols with this event (you can see the demo at All Features/Miscellaneous/Legend/Symbol OnDraw).
Note that for a legend where each item represents a point (with a concrete color) or a series (with a concrete color) it's easy to determine the symbol to draw. But having a group of series, there is not a clear unique solution (or we haven't determined yet) on which symbol has to be drawn.
Excuse me if I haven't been enough clear. I meant that the event OnDraw for symbol legend only seems to work for the normal legend, not for this tool. And I've added it to the wish list to be fixed asap (TV52014060).
So, for the normal legend it would be easy to draw the custom symbols with this event (you can see the demo at All Features/Miscellaneous/Legend/Symbol OnDraw).
Note that for a legend where each item represents a point (with a concrete color) or a series (with a concrete color) it's easy to determine the symbol to draw. But having a group of series, there is not a clear unique solution (or we haven't determined yet) on which symbol has to be drawn.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
I have to use an extra legend tool and not a normal legend (see my different post about the legend and the solution that you suggested for me in the past).
Note :
I know that you can't determine wich color we have to use for a group but i know that i would like to see in my legend (not a color in my case...)
I am afraid about your "ASAP" criteria. I am waiting a patch for a very important bug since 2005.
Note :
I know that you can't determine wich color we have to use for a group but i know that i would like to see in my legend (not a color in my case...)
I am afraid about your "ASAP" criteria. I am waiting a patch for a very important bug since 2005.
Hi stsl,
We understand that, in the customer side, some of you have important problems that demand immediate intervention, but without any doubt, you'll understand that we also have to value other aspects such as the number of customers affected, if there is a workaround or not, the percentage of the component that is affected, the relation cost/benefit of the implementation,...
Could you please tell us the number of the bug or the forum thread where this bug was discussed and we'll see its state?stsl wrote:I am waiting a patch for a very important bug since 2005.
We understand that, in the customer side, some of you have important problems that demand immediate intervention, but without any doubt, you'll understand that we also have to value other aspects such as the number of customers affected, if there is a workaround or not, the percentage of the component that is affected, the relation cost/benefit of the implementation,...
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Summary of my post, about a very critical bug (null values are different than 0 values) :
Posted: 02 Nov 2005 18:35 Post subject: Functions, period range and data leak
and your response
Posted: 07 Apr 2008 10:13 Post subject: Reply with quote
Hi stsl,
I've added the feature request to the wish list (TV52012945) to be reviewed and, if possible, enhanced in further releases. This may be quite a sensible issue as implementing it as you request may break existing clients code.
Also notice that we don't provide support for changes to the source code but you are free to implement the necessary customizations to fit your needs.
_________________
Best Regards
Yeray Alonso
Best regards
Posted: 02 Nov 2005 18:35 Post subject: Functions, period range and data leak
and your response
Posted: 07 Apr 2008 10:13 Post subject: Reply with quote
Hi stsl,
I've added the feature request to the wish list (TV52012945) to be reviewed and, if possible, enhanced in further releases. This may be quite a sensible issue as implementing it as you request may break existing clients code.
Also notice that we don't provide support for changes to the source code but you are free to implement the necessary customizations to fit your needs.
_________________
Best Regards
Yeray Alonso
Best regards
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi stsl,
Here's an update on the status of the issues discussed on this thread:
TV52014060: I've checked this already works fine here using something as the code below. Can you please check if this works fine for you?
TV52012945: We don't consider this being a bug but a feature request, which is very specific. In my opinion Yeray suggested you several options to achieve what you request using existing TeeChart features. Given all those circumstances it's most unlikely that it's implemented in v8. We don't have an estimate date for this being implemented either.
Here's an update on the status of the issues discussed on this thread:
TV52014060: I've checked this already works fine here using something as the code below. Can you please check if this works fine for you?
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
begin
Series1.FillSampleValues();
ChartTool1.Legend.Symbol.OnDraw:=LegendDraw;
end;
procedure TForm1.LegendDraw(Sender: TObject; Series:TChartSeries;
ValueIndex:Integer; R:TRect);
var Flag : TBitmap;
begin
Flag:=TBitmap.Create; // create flag bitmap
try
Dec(R.Top,3);
Inc(R.Bottom,3);
if ValueIndex mod 2 = 0 then
Flag.LoadFromFile('C:\temp\TeeCopy.bmp')
else
Flag.LoadFromFile('C:\temp\TeeDepth.bmp');
with Chart1.Canvas do
begin
StretchDraw(R,Flag); // draw image to legend
// draw border
if Chart1.Legend.Symbol.Pen.Visible then
begin
Brush.Style:=bsClear;
AssignVisiblePen(Chart1.Legend.Symbol.Pen);
Rectangle(R,0);
end;
end;
finally
Flag.Free; // destroy bitmap
end;
end;
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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi stsl,
Ok, the problem here is that series groups don't have symbol. So if you want to use symbols there you could use dummy series for that purpose, for example:V52014060 :
Did you use LegendStyle := lsGroups ?
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var i, j: Integer;
begin
Chart1.Legend.Visible:=false;
Series1.FillSampleValues();
ChartTool1.Legend.Symbol.OnDraw:=LegendDraw;
for i:=0 to Chart1.SeriesCount -1 do
Chart1[i].ShowInLegend:=false;
for j:=0 to Chart1.SeriesGroups.Count-1 do
begin
Chart1.AddSeries(TChartSeries.Create(self));
Chart1[Chart1.SeriesCount-1].ShowInLegend:=true;
Chart1[Chart1.SeriesCount-1].Title:=Chart1.SeriesGroups[j].Name;
end;
ChartTool1.Series:=Chart1[Chart1.SeriesCount-1];
ChartTool1.Legend.LegendStyle:=lsSeries;
end;
procedure TForm1.LegendDraw(Sender: TObject; Series:TChartSeries;
ValueIndex:Integer; R:TRect);
var Flag : TBitmap;
begin
Flag:=TBitmap.Create; // create flag bitmap
try
Dec(R.Top,3);
Inc(R.Bottom,3);
Flag.LoadFromFile('C:\root\TeeChartVCL\Sources8\TeeCopy.bmp');
{ if ValueIndex mod 2 = 0 then
Flag.LoadFromFile('C:\root\TeeChartVCL\Sources8\TeeCopy.bmp')
else
Flag.LoadFromFile('C:\root\TeeChartVCL\Sources8\TeeDepth.bmp');
}
with Chart1.Canvas do
begin
StretchDraw(R,Flag); // draw image to legend
// draw border
if Chart1.Legend.Symbol.Pen.Visible then
begin
Brush.Style:=bsClear;
AssignVisiblePen(Chart1.Legend.Symbol.Pen);
Rectangle(R,0);
end;
end;
finally
Flag.Free; // destroy bitmap
end;
end;
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 |
But i need a normal legend with series (not the dummies) and an extra legend with groups (dummies) and check box to disable one or more groups of other series. Is-it possible to do that ? I think that with dummies series it will be complicated.
Why did you disable the OnDrawLegend event when we have lsGroups ? There is no logical reason...
Why did you disable the OnDrawLegend event when we have lsGroups ? There is no logical reason...
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi stsl,
Yes, I'm afraid this would be complicated.But i need a normal legend with series (not the dummies) and an extra legend with groups (dummies) and check box to disable one or more groups of other series. Is-it possible to do that ? I think that with dummies series it will be complicated.
In my opinion the reason it is pretty simple, since series groups don't have symbols for the legend they can't fire the OnDraw event. This is already on the wish-list to be considered for inclusion in future releases.Why did you disable the OnDrawLegend event when we have lsGroups ? There is no logical reason...
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 |