PlotPanel: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: PlotPanel
| Old | New | Line | |
|---|---|---|---|
| 1 | + | > **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. | |
| 2 | + | ||
| 3 | + | ## Plotpanel | |
| 4 | + | ||
| 5 | + | PlotPanel 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. | |
| 6 | + | ||
| 7 | + | With PlotPanel you can draw line- , dot- and bar-graphs. Animated graphs are also possible. | |
| 8 | + | ||
| 9 | + | This software is presented as is, without any written warranty. So use the software at your own risk. | |
| 10 | + | ||
| 11 | + | ### Screenshot | |
| 12 | + | ||
| 13 | + | <figure> | |
| 14 | + | <img src="Plotpanel2.png" title="Plotpanel2.png" /> | |
| 15 | + | <figcaption>Plotpanel2.png</figcaption> | |
| 16 | + | </figure> | |
| 17 | + | ||
| 18 | + | ## Installation | |
| 19 | + | ||
| 20 | + | To Install the PlotPanel component in Lazarus you have to do the following: | |
| 21 | + | ||
| 22 | + | - 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). | |
| 23 | + | - Unzip plotpanel.zip in a directory of your choice. | |
| 24 | + | - Start Lazarus | |
| 25 | + | - Perform the necessairy actions to intall the package (see [[Install Packages]]). | |
| 26 | + | ||
| 27 | + | After 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 | |
| 28 | + | ||
| 29 | + | Run the PlotPanelDemo to explore the features of PlotPanel. N.B. You can try PlotPanel without installing the component by running TryPlotPanel! | |
| 30 | + | ||
| 31 | + | '''There was a problem with Plotpanel in Lazarus 0.9.28.x | |
| 32 | + | ||
| 33 | + | **On my website (http://science4all.nl/?Programming:MICAM:Lazarus) you can find the updated version: PlotPanel-0.97** | |
| 34 | + | ||
| 35 | + | ## Description of the PlotPanel component | |
| 36 | + | ||
| 37 | + | This 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. | |
| 38 | + | ||
| 39 | + | ## Properties inherited from TCustomPanel | |
| 40 | + | ||
| 41 | + | ||
| 42 | + | Align, Anchors, Autosize, BevelInner / Outer / Width | |
| 43 | + | ||
| 44 | + | Borderspacing, BorderStyle, Borderwidth | |
| 45 | + | ||
| 46 | + | Color is the color of the border of the plot | |
| 47 | + | ||
| 48 | + | Constraints, Cursor, Dragmode, Enabled | |
| 49 | + | ||
| 50 | + | Font is the font of the title of the plot | |
| 51 | + | ||
| 52 | + | Height, HelpContext, HelpKeyword, HelpType, Hint | |
| 53 | + | ||
| 54 | + | Left, Name, ParenColor, Parentfont, ParentShowHint | |
| 55 | + | ||
| 56 | + | PopupMenu, ShowHint, TabOrder, TabStop | |
| 57 | + | ||
| 58 | + | Tag, Top, Visible, Width | |
| 59 | + | ||
| 60 | + | ## The following properties are added | |
| 61 | + | ||
| 62 | + | ||
| 63 | + | **BackColor**This is the background color of the plotting area | |
| 64 | + | ||
| 65 | + | **GridColor**When you make this the same as Backcolor, the grid is invisible | |
| 66 | + | ||
| 67 | + | **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) | |
| 68 | + | ||
| 69 | + | **Margin** The width of the border of the plot in pixels | |
| 70 | + | ||
| 71 | + | **PlotMode** Three plotmodes are possible: pmBar, pmLine and pmDot | |
| 72 | + | ||
| 73 | + | **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) | |
| 74 | + | ||
| 75 | + | **Title** The Title is at the top center of the plot and uses the Font property | |
| 76 | + | ||
| 77 | + | **PlotBMP** This is a bitmap holding the whole graph (see demo for its use) | |
| 78 | + | ||
| 79 | + | **The X-axis properties:** | |
| 80 | + | ||
| 81 | + | ||
| 82 | + | **XLabel** Label at the X-axis | |
| 83 | + | ||
| 84 | + | **XMarks** When True, the X-axis has marks | |
| 85 | + | ||
| 86 | + | **XMarksFont** Font used for the XMarks | |
| 87 | + | ||
| 88 | + | **XMarksInterval** Interval between to lines in the grid (applies for linear scales only) | |
| 89 | + | ||
| 90 | + | **XMax** Maximum value of X that is visible | |
| 91 | + | ||
| 92 | + | **XMin**Minimal value of X that is visible | |
| 93 | + | ||
| 94 | + | **XScaleLog**When TRUE the scale is logarithmic (the interval is determined by the component) | |
| 95 | + | ||
| 96 | + | **For the Y-axis the same applies.** | |
| 97 | + | ||
| 98 | + | ## Methods: | |
| 99 | + | ||
| 100 | + | **AddXY(X,Y:Extended)** | |
| 101 | + | ||
| 102 | + | ` With this method you can add points (or lines) to the plot`\ | |
| 103 | + | ` Example`\ | |
| 104 | + | ` for i:= -10 to 10 do`\ | |
| 105 | + | ` PlotPanel1.AddXY(i,i*i)`\ | |
| 106 | + | ` This plots a parbola .The line is plotted with the PlotPen properties`\ | |
| 107 | + | ` Note you can only plot a single layer.` | |
| 108 | + | ||
| 109 | + | **AddXY(X,Y:Extended, Color:Tcolor,Layer:Integer)** | |
| 110 | + | ||
| 111 | + | ` With this method it is possible to plot up to 8 lines in different colors,`\ | |
| 112 | + | ` plotmodes and penwidths (see LayerOptions how to set linewidth and plotmodes)` | |
| 113 | + | ||
| 114 | + | **LayerOptions(Layer:Integer;PlotMode:TPlotMode;PenWidth:Integer)** | |
| 115 | + | ||
| 116 | + | ` Every Layer can use a different Plotmode and PenWidth`\ | |
| 117 | + | ` When you call this method LayerOPtion will be set TRUE. When you want`\ | |
| 118 | + | ` to use a single Layer again you have to set LayerOption False!` | |
| 119 | + | ||
| 120 | + | **Autoscale(Layer:Integer)** | |
| 121 | + | ||
| 122 | + | ` With this method you can adjust the size of the plot automaticly` | |
| 123 | + | ||
| 124 | + | **ClearData** | |
| 125 | + | ||
| 126 | + | ` Clears the data on the plot.` | |
| 127 | + | ||
| 128 | + | **ConvertS2W(x,y: Extended; var WX,WY : Extended)** | |
| 129 | + | ||
| 130 | + | ` Converts the screen-coordinates in X,Y to the real coordinates WX,WY. When`\ | |
| 131 | + | ` X and Y are out of bounds, the function returns False, otherwise True` | |
| 132 | + | ||
| 133 | + | **Freeze(Boolean)** | |
| 134 | + | ||
| 135 | + | ` When Freeze(True) is executed all plotting is done on a invisible bitmap.`\ | |
| 136 | + | ` After a Freeze(False) the whole plot is displayed. This produces flicker-free`\ | |
| 137 | + | ` animations.` | |
| 138 | + | ||
| 139 | + | **HideLayer(Layer:Integer)** | |
| 140 | + | ||
| 141 | + | ` Use this to hide a single layer in the plot` | |
| 142 | + | ||
| 143 | + | **UnHideLayer(Layer:Integer)** | |
| 144 | + | ||
| 145 | + | ` Shows the hidden layer again`\ | |
| 146 | + | ` N.B. When you add points to a hidden layer, the old layer is deleted and the`\ | |
| 147 | + | ` new points are the only points in this layer!` | |
| 148 | + | ||
| 149 | + | **Paint** | |
| 150 | + | ||
| 151 | + | ` Repaints the whole Graph (is done automaticly by the system when necessairy)` | |
| 152 | + | ||
| 153 | + | Marien van Westen | |
| 154 | + | ||
| 155 | + | --- | |
| 156 | + | *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).* | |
| 157 | + | Category: Charting | |
| 158 | + | Category: Components | |
| 159 | + | Category: Graphics |
