TeeChart, Drag circle arround a point

38 views Asked by At

I need to draw a circle around a specific point

Hello how are you? I'm working with Teechart on c# /net . I need to draw a circle around a specific point when its value exceeds a given range. I can't do it. unlike native net chat, dot is a class that is assigned a style. not here.

I find it very difficult

Thank you

1

There are 1 answers

0
MBo On

Don't sure what events and properties dotnet version of TeeChart has (perhaps due to your unlike native net chat, dot is a class that is assigned a style. not here. my advice is not applicable)

But in Delphi I can do the next: make event handler for OnGetPointerStyle and assign pointer style for every point depending on Y-value:

function TForm1.Series1GetPointerStyle(Sender: TChartSeries;
  ValueIndex: Integer): TSeriesPointerStyle;
begin
  if Series1.YValues[ValueIndex] > 0.5 then
    Result := TSeriesPointerStyle.psCircle
  else
    Result := TSeriesPointerStyle.psNothing
end;

Result:

enter image description here

Also Delphi version gives access to Canvas, so we can just draw circle in needed position

procedure TForm1.Chart1AfterDraw(Sender: TObject);
begin
  Chart1.Canvas.Ellipse(10,10,20,20);
  //really we have to remember positions on needed points in 
  // some list and draw cicles here
end;