Page 1 of 1

Equal points on a graph overlap.

Posted: Mon Feb 20, 2006 2:06 pm
by 9343708
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]

Posted: Mon Feb 20, 2006 2:22 pm
by narcis
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;

End user - have no access to the source code

Posted: Mon Feb 20, 2006 2:34 pm
by 9343708
I am trying to do this by using the chart settings at runtime.

Posted: Mon Feb 20, 2006 2:44 pm
by narcis
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;

Posted: Mon Feb 20, 2006 2:59 pm
by 9343708
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?

Posted: Mon Feb 20, 2006 3:46 pm
by narcis
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.