How to make marks have sizes in absolute pixels?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Michael Heinrich
Newbie
Newbie
Posts: 20
Joined: Thu Feb 04, 2010 12:00 am

How to make marks have sizes in absolute pixels?

Post by Michael Heinrich » Tue Mar 09, 2010 9:08 am

Hello,

I want to have marks that will always be readable even if you change the zoom in the chart. Is it possible to make marks have a minimum of pixels width and height?
If that is not possible would it be possible to have marks have a width to a percentage of the chart or some other absolute property?
I have also considered 3dtext tools that I position at the base of a tower in a tower3d series to show extra data. Is it a good idea, performance wise to add a lot of 3dtext tools (one for each tower) that show the data.
The idea is that the user can rotate freely through the chart to look at labels and towers.

Thanks in advance,
Michael.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: How to make marks have sizes in absolute pixels?

Post by Narcís » Tue Mar 09, 2010 2:12 pm

Hi Michael,

You can try customizing your marks as in the 2 different examples you'll find on this thread.

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
Image Image Image Image Image Image
Instructions - How to post in this forum

Michael Heinrich
Newbie
Newbie
Posts: 20
Joined: Thu Feb 04, 2010 12:00 am

Re: How to make marks have sizes in absolute pixels?

Post by Michael Heinrich » Wed Mar 10, 2010 2:50 pm

I have used most of the suggestions in the previous post but I have run into a problem with the positions of marks.
Below I have added a simple click event that uses a TChart named as Chart1 on the form. A OpenGL component is linked and active to the TChart.
How do I manage positions after I have added a point to the chart? The positions of the marks remain empty after adding a point and I have no idea how to add a position.

Code: Select all

procedure TFormSomething.btnAddSeriesClick(Sender: TObject);
const
  cSize = 10;
var
  l3DPoints: TPoint3DSeries;
  X: integer;
  Y: integer;
  Z: integer;
  lMarkPosition: TSeriesMarkPosition;
begin
  l3DPoints := TPoint3DSeries.Create( Self );

  for x := 0 to cSize-1 do
  begin
    for z := 0 to cSize-1 do
    begin
       l3DPoints.AddXYZ( x, 0.2, z-0.5 );
       l3DPoints.ValueMarkText[ l3DPoints.Count-1 ] := 'loc(' + intToStr( x ) + ',' + intToStr( z ) + ')';
       // Now  Marks.Positions.Count = 0 which makes it impossible to change the position of a mark
       lMarkPosition := l3DPoints.Marks.Positions.Position[ l3DPoints.Count-1 ];
       lMarkPosition.Custom := True;
       lMarkPosition.Width := lMarkPosition.Width*2;
    end;
  end;

  Chart1.ClearChart;

  Chart1.AddSeries( l3DPoints );
  l3DPoints.DrawBetweenPoints := False;
  l3DPoints.LinePen.Hide;
  l3DPoints.Marks.Visible := True;
  l3DPoints.Marks.Transparent := True;
  l3DPoints.Marks.Font.Size := 12;
  l3DPoints.Pointer.Hide;
end;

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: How to make marks have sizes in absolute pixels?

Post by Yeray » Thu Mar 11, 2010 9:42 am

Hi Michael,

The positions are empty until the chart will be drawn. I'd recommend you to force a chart draw after adding all your data and after that, loop your values to modify their positions if you want.

Code: Select all

  Chart1.Draw;
  for X:=0 to l3DPoints.Count-1 do
  begin
    lMarkPosition := l3DPoints.Marks.Positions.Position[ l3DPoints.Count-1 ];
    lMarkPosition.Custom := True;
    lMarkPosition.Width := lMarkPosition.Width*2;
  end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply