When a series has it's Transparent value set, the color of the series may altered, but the color in the legend uses the non-transparent color.
For example, see
http://www.TRAKCentral.com/files/BatchG ... xample.jpg
where the two green colors are the same color--but the shortfall has Transparency value is set to 60--but the legend doesn't communicate this.
Is there a way the legend will show the color shown in the graph?
Transparent series and legend colors
-
- Advanced
- Posts: 228
- Joined: Tue Aug 28, 2007 12:00 am
- Location: Oregon, USA
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi TestAlways,
I've been able to reproduce the issue here and added it to our defect list to be enhanced for future releases.
In the meantime, the only alternative I can think of is manually setting legend symbols as shown at the All Features\Miscellaneous\Legend\Symbol OnDraw example in the features demo, available at TeeChart's program group.
I've been able to reproduce the issue here and added it to our defect list to be enhanced for future releases.
In the meantime, the only alternative I can think of is manually setting legend symbols as shown at the All Features\Miscellaneous\Legend\Symbol OnDraw example in the features demo, available at TeeChart's program group.
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 |
-
- Advanced
- Posts: 228
- Joined: Tue Aug 28, 2007 12:00 am
- Location: Oregon, USA
I don't know where to find that--I've searched my Steema directory ("TeeChart 80 for Delphi 7") an there is no "Miscellaneous" directory.narcis wrote:In the meantime, the only alternative I can think of is manually setting legend symbols as shown at the All Features\Miscellaneous\Legend\Symbol OnDraw example in the features demo, available at TeeChart's program group.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi TestAlways,
I'd like to apologise if I wasn't specific enough on my explanation. I meant that the example should be found at the new features demo, which can be found at TeeChart's program group (Start menu -> All Programs -> Steema TeeChart v8.01 for Delphi 7). This demo is only included with the specific binary installer for each IDE. So if you are a sourcecode customer I strongly recommend you to first install using the binary installer to obtain all documentations, examples, tutorials, etc. Later install source code.
Hope this helps!
I'd like to apologise if I wasn't specific enough on my explanation. I meant that the example should be found at the new features demo, which can be found at TeeChart's program group (Start menu -> All Programs -> Steema TeeChart v8.01 for Delphi 7). This demo is only included with the specific binary installer for each IDE. So if you are a sourcecode customer I strongly recommend you to first install using the binary installer to obtain all documentations, examples, tutorials, etc. Later install source code.
Hope this helps!
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 |
-
- Advanced
- Posts: 228
- Joined: Tue Aug 28, 2007 12:00 am
- Location: Oregon, USA
Below is my attempt, which is not working. I checked, and the first block is run, but it draws the legend as if it was solid, not transparent.
What do I need to change?
Thanks
Code: Select all
if...then
What do I need to change?
Thanks
Code: Select all
procedure TdmBPPrinting.GapChartLegendDraw(Sender: TObject; Series:TChartSeries; ValueIndex:Integer; R:TRect);
var
lCanvas: TCanvas3D;
lBlend: TTeeBlend;
lAreaSeries: TAreaSeries;
lChart: TCustomAxisPanel;
begin
Assert(Series is TAreaSeries);
lAreaSeries := TAreaSeries(Series);
lChart := Series.ParentChart;
lCanvas := lChart.Canvas;
lCanvas.Brush.Color := Series.Color;
if lAreaSeries.Transparency > 0 then
begin
lBlend := lCanvas.BeginBlending(r, lAreaSeries.Transparency);
try
lCanvas.FillRect(R); // <<--- Draws solid color, not transparency color
finally
lCanvas.EndBlending(lBlend);
end;
end
else
lChart.Canvas.FillRect(R);
end;
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi TestAlways,
This is most likely because you need to set Canvas' color before doing the custom drawing, something like this:
This is most likely because you need to set Canvas' color before doing the custom drawing, something like this:
Code: Select all
procedure TForm1.LegendDraw(Sender: TObject; Series: TChartSeries;
ValueIndex: Integer; R: TRect);
var
lBlend: TTeeBlend;
begin
Chart1.Canvas.Brush.Color := Series1.Color;
if Series1.Transparency > 0 then
begin
lBlend := Chart1.Canvas.BeginBlending(R, Series1.Transparency);
try
Chart1.Canvas.Rectangle(R);
finally
Chart1.Canvas.EndBlending(lBlend);
end;
end
else
Chart1.Canvas.Rectangle(R);
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 |
-
- Advanced
- Posts: 228
- Joined: Tue Aug 28, 2007 12:00 am
- Location: Oregon, USA
Looking at my code snippet, I did:This is most likely because you need to set Canvas' color before doing the custom drawing
Code: Select all
Canvas.Brush.Color := Series.Color;
Code: Select all
Chart1.Canvas.Rectangle(R); //yours
Code: Select all
lCanvas.FillRect(R); //mine
Thank you.