Recent

Author Topic: Which package are the chart Pointer.Style enums in?  (Read 926 times)

sdawilson

  • New Member
  • *
  • Posts: 14
Which package are the chart Pointer.Style enums in?
« on: May 26, 2024, 10:17:21 pm »
Hi all,

I'm teaching myself Lazarus (very impressed), but I'm really struggling with an "identifier not found" for the "ps" enums:

Code: Pascal  [Select][+][-]
  1.         case pPointer of
  2.           'cross': pSeriesXY.Pointer.Style := psCross;
  3.           'circle': pSeriesXY.Pointer.Style:= psCircle;
  4.           'diacross': pSeriesXY.Pointer.Style := psDiagCross;
  5.           'diamond': pSeriesXY.Pointer.Style := psDiamond;
  6.           'triange': pSeriesXY.Pointer.Style := psTriangle ;
  7.         end;

I'm obviously missing a "uses" reference somewhere, but I can't find which one.

Currently, I have these libraries:

Code: Pascal  [Select][+][-]
  1. uses
  2.   LazUtils, StrUtils, FileUtil, TAGraph, TASeries, TAStyles, TATools, TAChartImageList, ]"]>BlockedltiSeries, Classes,
  3.   SysUtils, Forms, Controls, Graphics, Dialogs, Grids, StdCtrls, ComCtrls, ValEdit, TACustomSeries, TASources,
  4.   Types, TACustomSource, TADrawUtils, TAChartUtils, TAChartAxisUtils;  

I'd be very grateful, if someone could point me in the right direction.

Thank you.

jamie

  • Hero Member
  • *****
  • Posts: 6735
Re: Which package are the chart Pointer.Style enums in?
« Reply #1 on: May 26, 2024, 10:23:37 pm »
You must be using an example for TAchart ?
The only true wisdom is knowing you know nothing

sdawilson

  • New Member
  • *
  • Posts: 14
Re: Which package are the chart Pointer.Style enums in?
« Reply #2 on: May 26, 2024, 10:26:20 pm »
Yes. I've built a little app that reads a text file that contains chart parameters and writes them to a TAChart and then exports the chart to a PNG. All went well until I needed to use to pointer type enums.

wp

  • Hero Member
  • *****
  • Posts: 12464
Re: Which package are the chart Pointer.Style enums in?
« Reply #3 on: May 26, 2024, 10:34:27 pm »
The easiest and most general way, in my opinion, is to learn how to navigate source code with Lazarus.

Suppose your code contains this fragment:
Code: Pascal  [Select][+][-]
  1.  Chart1LineSeries1.Pointer.Style := psCircle;

Hold the CTRL key down and move the mouse over "psCircle" - nothing happens because this identifier is in a unit which is not yet listed in the uses clause. Move it further to the left, over "Style" (still CTRL pressed). Now the word becomes underlined, and the mouse cursor turns into a hand indicating that you can click on "Style". Do this - CTRL-click on "Style". This make the IDE to open the unit in which the Pointer.Style property is declared, unit TATypes (find this in the editor tab), and the editor cursor will be in the line
Code: Pascal  [Select][+][-]
  1.     property Style: TSeriesPointerStyle read FStyle write SetStyle default psRectangle;
Here you see the type of the "Style" property: TSeriesPointerStyle. Now repeat the same with this word: CTRL-click on "TSeriesPointerStyle" --> the IDE jumps to the line where the TSeriesPointerStyle enumeration is declared, and you see all its values, among them the "psCircle" requested by the sample code above. Incidentally this is in the same unit, TATypes.

So, the answer to your question is: The series pointer styles are declared in unit TATypes.
« Last Edit: May 26, 2024, 10:37:33 pm by wp »

sdawilson

  • New Member
  • *
  • Posts: 14
Re: Which package are the chart Pointer.Style enums in?
« Reply #4 on: May 26, 2024, 10:37:48 pm »
You're a star... thank you very much!

Lesson learned!

 

TinyPortal © 2005-2018