Sign in Join
Wiki copytemporary

PlotPanel: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11> **Warning:** Currently, PlotPanel is not in active development and is maintained for compatibility only. Please consider using [[TAChart documentation|Functional series]] of [[TAChart]] package instead.
22
33## Plotpanel
44
55PlotPanel is a component for Lazarus to replace (more or less) the TChart component. With some modification it can also be used with Kylix, Delphi 5, 6 or 7.
66
77With PlotPanel you can draw line- , dot- and bar-graphs. Animated graphs are also possible.
88
99This software is presented as is, without any written warranty. So use the software at your own risk.
1010
1111### Screenshot
1212
13-<figure>
14-<img src="Plotpanel2.png" title="Plotpanel2.png" />
15-<figcaption>Plotpanel2.png</figcaption>
16-</figure>
13+![](/wiki-images/2/24/Plotpanel2.png)
1714
1815## Installation
1916
2017To Install the PlotPanel component in Lazarus you have to do the following:
2118
2219- Download the PlotPanelpackage (plotpanel.zip) from: <http://science4all.nl/?Programming:MICAM:Lazarus> or from [Lazarus CCR SourceForge site](http://sourceforge.net/project/showfiles.php?group_id=92177&package_id=181065).
2320- Unzip plotpanel.zip in a directory of your choice.
2421- Start Lazarus
2522- Perform the necessairy actions to intall the package (see [[Install Packages]]).
2623
2724After you have done that all, there must be a new Tab in the component palet with the name "Extra". You can use the Plotpanel now
2825
2926Run the PlotPanelDemo to explore the features of PlotPanel. N.B. You can try PlotPanel without installing the component by running TryPlotPanel!
3027
3128'''There was a problem with Plotpanel in Lazarus 0.9.28.x
3229
3330**On my website (http://science4all.nl/?Programming:MICAM:Lazarus) you can find the updated version: PlotPanel-0.97**
3431
3532## Description of the PlotPanel component
3633
3734This is a very rude description of the component. See the examples for an explanation of how to use the component. The PlotPanel component is derived from the TCustomPanel-component. To this Panel plotting capabilities are added.
3835
3936## Properties inherited from TCustomPanel
4037
4138
4239Align, Anchors, Autosize, BevelInner / Outer / Width
4340
4441Borderspacing, BorderStyle, Borderwidth
4542
4643Color is the color of the border of the plot
4744
4845Constraints, Cursor, Dragmode, Enabled
4946
5047Font is the font of the title of the plot
5148
5249Height, HelpContext, HelpKeyword, HelpType, Hint
5350
5451Left, Name, ParenColor, Parentfont, ParentShowHint
5552
5653PopupMenu, ShowHint, TabOrder, TabStop
5754
5855Tag, Top, Visible, Width
5956
6057## The following properties are added
6158
6259
6360**BackColor**This is the background color of the plotting area
6461
6562**GridColor**When you make this the same as Backcolor, the grid is invisible
6663
6764**LayerOption**For easy plotting of a single layer this can be set to False. It is not possible to set this to True directly (see methods)
6865
6966**Margin** The width of the border of the plot in pixels
7067
7168**PlotMode** Three plotmodes are possible: pmBar, pmLine and pmDot
7269
7370**PlotPen** Properties of the plotting pen. If LayerOption is False, then all sub-properties can be set. If LayerOption is True, then information about the plotting pen is transferred via the LayerOptions method (methods)
7471
7572**Title** The Title is at the top center of the plot and uses the Font property
7673
7774**PlotBMP** This is a bitmap holding the whole graph (see demo for its use)
7875
7976**The X-axis properties:**
8077
8178
8279**XLabel** Label at the X-axis
8380
8481**XMarks** When True, the X-axis has marks
8582
8683**XMarksFont** Font used for the XMarks
8784
8885**XMarksInterval** Interval between to lines in the grid (applies for linear scales only)
8986
9087**XMax** Maximum value of X that is visible
9188
9289**XMin**Minimal value of X that is visible
9390
9491**XScaleLog**When TRUE the scale is logarithmic (the interval is determined by the component)
9592
9693**For the Y-axis the same applies.**
9794
9895## Methods:
9996
10097**AddXY(X,Y:Extended)**
10198
10299`   With this method you can add points (or lines) to the plot`\
103100`   Example`\
104101`   for i:= -10 to 10 do`\
105102`      PlotPanel1.AddXY(i,i*i)`\
106103`   This plots a parbola .The line is plotted with the PlotPen properties`\
107104`   Note you can only plot a single layer.`
108105
109106**AddXY(X,Y:Extended, Color:Tcolor,Layer:Integer)**
110107
111108`   With this method it is possible to plot up to 8 lines in different colors,`\
112109`   plotmodes and penwidths (see LayerOptions how to set linewidth and plotmodes)`
113110
114111**LayerOptions(Layer:Integer;PlotMode:TPlotMode;PenWidth:Integer)**
115112
116113`   Every Layer can use a different Plotmode and PenWidth`\
117114`   When you call this method LayerOPtion will be set TRUE. When you want`\
118115`   to use a single Layer again you have to set LayerOption False!`
119116
120117**Autoscale(Layer:Integer)**
121118
122119`   With this method you can adjust the size of the plot automaticly`
123120
124121**ClearData**
125122
126123`   Clears the data on the plot.`
127124
128125**ConvertS2W(x,y: Extended; var WX,WY : Extended)**
129126
130127`   Converts the screen-coordinates in X,Y to the real coordinates WX,WY. When`\
131128`   X and Y are out of bounds, the function returns False, otherwise True`
132129
133130**Freeze(Boolean)**
134131
135132`   When Freeze(True) is executed all plotting is done on a invisible bitmap.`\
136133`   After a Freeze(False) the whole plot is displayed. This produces flicker-free`\
137134`   animations.`
138135
139136**HideLayer(Layer:Integer)**
140137
141138`   Use this to hide a single layer in the plot`
142139
143140**UnHideLayer(Layer:Integer)**
144141
145142`   Shows the hidden layer again`\
146143`   N.B. When you add points to a hidden layer, the old layer is deleted and the`\
147144`   new points are the only points in this layer!`
148145
149146**Paint**
150147
151148`   Repaints the whole Graph (is done automaticly by the system when necessairy)`
152149
153150Marien van Westen
154151
155152---
156153*From the Free Pascal wiki, page "PlotPanel", as it stood on 2016-07-18 after a change by Arent, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
157154Category: Charting
158155Category: Components
159156Category: Graphics

Back to history