The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



SetItemParams


Unit:SDL_rchart
Class: TRChart
Declaration: procedure SetItemParams (Item: longint; ItParams: TDrawCan);

The method SetItemParams sets the parameters of a single chart item. The input parameter Item is the index of the item (c.f. array property DataContainer). The parameter ItParams is of the type TrcChartItem and contains the information on the item.

Hint: With release 8.0 of the SDL Component Suite the data model of RCHART has been changed from a linked list to a dynamic array which is accessible via the array property DataContainer. The method SetItemParams has been kept for compatibility purposes, future designs should use the property DataContainer.

Example: For the following example suppose that the user has clicked the mouse somewhere on the chart area. The code below shows how to change the color of the nearest item on the chart to a blue color.
var
  Item  : longint;
  ItPar : TrcChartItem;
  dist  : double;

begin
with RChart1 do
  begin
  Item := FindNearestItemScreen (MousePosX, MousePosY, tkEverything, 255, dist);
  if Item <> -1 then
    begin
    Itpar := GetItemParams (Item);
    ItPar.Color := clBlue;
    SetItemParams (Item, ItPar);
    ShowGraf;
    end;
  end;
end;

Example: This method is used in the following example program (see http://www.lohninger.com/examples.html for downloading the code): spline



Last Update: 2014-Sep-12