Page 1 of 1

Marks - Behind Bar Series

Posted: Wed Jan 12, 2005 11:12 am
by 8575104
Hi

I'm having the problem : marks behind the series when I use Bar Series and 2D ( in 3D it's OK ). I'm using the TChart that comes with Delphi 5.0. I calculate the marks points manually, but it isn't the cause. Is there a patch for this problem ?

Regards,

Marcelo

Posted: Wed Jan 12, 2005 3:54 pm
by narcis
Hi Marcelo,

I haven't been able to reproduce this problem here. Could you please send us a small project that we can run "as-is" to reproduce the problem here?

You can post the project at the steema.public.attachments newsgroups.

Code

Posted: Wed Jan 12, 2005 4:19 pm
by 8575104
Hi Narcis

I didn't get acess the newsgroup. Below is the code (.pas and .dfm) :

.pas

Code: Select all

unit Graficos;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ExtCtrls, TeeProcs, TeEngine, Chart, Series;

type
  TForm1 = class(TForm)
    Chart1: TChart;
    Series1: TBarSeries;
    Series2: TBarSeries;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
var i,j : integer;
begin
  for i:=0 to 1 do
    for j:=0 to 9 do
      Chart1[i].AddXY(j,Random(100000),'',clteecolor);
end;

end.
.dfm

Code: Select all

object Form1: TForm1
  Left = 133
  Top = 62
  Width = 768
  Height = 612
  Caption = 'Form1'
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  OnCreate = FormCreate
  PixelsPerInch = 96
  TextHeight = 13
  object Chart1: TChart
    Left = 0
    Top = 0
    Width = 1025
    Height = 713
    BackWall.Brush.Color = clWhite
    BackWall.Brush.Style = bsClear
    Title.Text.Strings = (
      'TChart')
    View3D = False
    TabOrder = 0
    object Series1: TBarSeries
      Marks.ArrowLength = 8
      Marks.Frame.Visible = False
      Marks.Transparent = True
      Marks.Visible = True
      SeriesColor = clRed
      XValues.DateTime = False
      XValues.Name = 'X'
      XValues.Multiplier = 1
      XValues.Order = loAscending
      YValues.DateTime = False
      YValues.Name = 'Bar'
      YValues.Multiplier = 1
      YValues.Order = loNone
    end
    object Series2: TBarSeries
      Marks.ArrowLength = 8
      Marks.Frame.Visible = False
      Marks.Transparent = True
      Marks.Visible = True
      SeriesColor = clGreen
      XValues.DateTime = False
      XValues.Name = 'X'
      XValues.Multiplier = 1
      XValues.Order = loAscending
      YValues.DateTime = False
      YValues.Name = 'Bar'
      YValues.Multiplier = 1
      YValues.Order = loNone
    end
  end
end
see the picture :

Image

Regards.
narcis wrote:Hi Marcelo,

I haven't been able to reproduce this problem here. Could you please send us a small project that we can run "as-is" to reproduce the problem here?

You can post the project at the steema.public.attachments newsgroups.

Posted: Thu Jan 13, 2005 12:35 pm
by narcis
Hi Marcelo,

The solution depends on the TeeChart version you are using. According to our sales department, your license number corresponds to a TeeChart Pro v6 VCL With Source Code.

If you were using a Pro version then you can replace the series marks for an anotation tool.

If you use a standard version then you can implement the OnAfterDraw TChart event to place the marks in a place where are not placed behind bars.

Marks - Behind Bar Series

Posted: Thu Jan 13, 2005 1:59 pm
by 8575104
Ok. In this specific application I'm using the Standard version included in Delphi 5.0. I'm already using OnAfterDraw to draw the marks position, but in this case it's necessary the marks appear in front of the bar, else the layout of the chart will be terrible, with marks 'lost' in the chart.
This problem could be treated like a bug.

tks.

Posted: Thu Jan 13, 2005 2:55 pm
by narcis
Hi Marcelo,

Yes, we can consider it a deffect but it having a workaround makes it not so severe.