Equal points on a graph overlap.

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Cura
Newbie
Newbie
Posts: 7
Joined: Tue Oct 04, 2005 4:00 am

Equal points on a graph overlap.

Post by Cura » Mon Feb 20, 2006 2:06 pm

Hi. I have a chart with a point series. Problem is that many of the points
are equal and therefore I cannot relate the points to the legend.

In other words I have no idea where the item in the legend is plotted on the
graph. Is there any way of showing all of the points on the graph or maybe
colour equal points the same instead of colouring them differently because the different colours appear in the legend separately but on the chart the coloured points are hidden underneath others with the same value

Please help. Also, how can I attach a screenshot of this?

TA!




--------------------------------------------------------------------------------

[/img]

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

Post by Narcís » Mon Feb 20, 2006 2:22 pm

Hi Cura,

You can use the series GetPointerStyle event doing something like:

Code: Select all

function TForm1.Series1GetPointerStyle(Sender: TChartSeries;
  ValueIndex: Integer): TSeriesPointerStyle;
var
  YVal: Double;
begin
  YVal:=Sender.YValues[ValueIndex];

  With (Sender as TPointSeries).Pointer do
    case Trunc(YVal) of
      0..32:
          begin
            Size:=2;
            Color:=clRed;
          end;
      33..65:
          begin
            Size:=4;
            Color:=clBlue;
          end;
      66..99:
          begin
            Size:=6;
            Color:=clYellow;
          end;
    end;

  result:=psRectangle;
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
Image Image Image Image Image Image
Instructions - How to post in this forum

Cura
Newbie
Newbie
Posts: 7
Joined: Tue Oct 04, 2005 4:00 am

End user - have no access to the source code

Post by Cura » Mon Feb 20, 2006 2:34 pm

I am trying to do this by using the chart settings at runtime.

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

Post by Narcís » Mon Feb 20, 2006 2:44 pm

Hi Cura,

This is at run-time. Another thing you could do is something like the snippet below. However, if you meant design-time instead of run-time, then I'm afraid it is not possible.

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
var
  val: double;
  i: Integer;
begin
  Series1.ColorEachPoint:=true;

  for i:=0 to 10 do
  begin
    val:=random(100);

    if val > 50 then
      Series1.Add(val,'',clRed)
    else
      Series1.Add(val,'',clBlue);
  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
Image Image Image Image Image Image
Instructions - How to post in this forum

Cura
Newbie
Newbie
Posts: 7
Joined: Tue Oct 04, 2005 4:00 am

Post by Cura » Mon Feb 20, 2006 2:59 pm

I meant I do not have access to the code. I am using ReportBuilder which has your TeeChart integrated in their software. They are unable to help me. I am trying to use your chart. Surely there must be a setting for this if you can manipulate it in code?

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

Post by Narcís » Mon Feb 20, 2006 3:46 pm

Hi Cura,

Ok, however, at least, you could do the same as the 2nd code snippet I posted. If this can not be done with Report Builder then you'll have to ask Digital Metaphors (RB manufacturers) as they implemented the Report Builder wrapper for TeeChart.
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

Post Reply