[Lazarus] TAChart marks on mouseoverpoint

Andrea Mauri andrea.mauri.75 at gmail.com
Tue Sep 22 12:36:26 CEST 2009


I tested the dragdrop demo. It works well anyway I have some 
questions/doubts about how marks are showed.
1. If the point is on the border of the chart the mark is not fully 
visible.
2. I have charts with a lot of points, the marks are shown below the 
points, so often the marks are not fully visible.

I have also another question. I need to draw a unitary circle on a 
chart. Here the function I use:
 
// Draws a unitary circle on the given TAChart with the given color
  procedure UnitCircle(ParentChart: TChart; Color: TColor);
  var
    A, B: TDoublePoint;
    AA, BB: TPoint;
  begin
    A.X:=-1;
    A.Y:=-1;
    B.X:=1;
    B.Y:=1;
    AA := ParentChart.GraphToImage (A);
    BB := ParentChart.GraphToImage(B);
    ParentChart.Canvas.Pen.Mode:= pmCopy;
    ParentChart.Canvas.Pen.Color:= Color;
    ParentChart.Canvas.Pen.Style:= psDash;
    ParentChart.Canvas.Brush.Style:= bsClear;
    ParentChart.Canvas.Ellipse(AA.x,AA.y,BB.x,BB.y);
  end;

Anyway I don't know when/where I have to call this procedure in order to 
be sure that the unitary circle is drawn upon the chart. If I anchor the 
chart on the form and I put my procedure on the resizeform event I can 
see the circle for a while and then it immediately disappears.
So how can I draw shapes on a chart? I have to put unitary circle but 
also other things, such as rays from the origin of the chart (0, 0) to 
all the points in a serie.
Could you help me?
regards,
andrea


Andrea Mauri ha scritto:
> I use trunk version of lazarus so I will check it.
> thanks,
> andrea
>
> Alexander Klenin ha scritto:
>> On Mon, Sep 21, 2009 at 23:39, Andrea Mauri 
>> <andrea.mauri.75 at gmail.com> wrote:
>>  
>>> Dear all,
>>> I am using TAChart and I would like to see the mark of a point when the
>>> point is clicked or the mouse is over it.
>>> Actually I do it using tchart.hint, TChartMouseMove event and
>>> GetNearestPoint function. In this way I show an hint any time the 
>>> mouse pass
>>> over a point. Is it possible to do it directly using Marks of TChart?
>>> I would like to decide to show the mark of a single point and not 
>>> for all
>>> the points in the serie.
>>>     
>>
>> If you do not mind using trunk version, then it is now possible ;-)
>> See dragdropdemo project.
>> Note however that this might have performance implications compared 
>> to your
>> implementation, because showing/hiding the mark requires full chart 
>> redraw.
>>
>>   
>
> -- 
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>




More information about the Lazarus mailing list