Sign in Join
Wiki copytemporary

NiceChart: what changed

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

OldNewLine
11The following text is based on the *readme.html* file which is included in the *NiceChart* installation directory. It is written by the original author of the component, [[priyatna.org|Priyatna]]. The text was also published on the author's web site which, however, is not available any more.
22
33## Introduction
44
5-<figure>
6-<img src="nicechart.png" title="nicechart.png" />
7-<figcaption>nicechart.png</figcaption>
8-</figure>
5+![](/wiki-images/d/d8/Nicechart.png)
96
107Once I need a chart component that can shows interpolated lines for one of my project. I don't need a sophisticated full-featured chart, I just need a simple one with basic functionalities. Don't find a way to do it with standard Delphi TChart component, I decided to write my own.
118
129Currently it has three graph styles: lines, smooth lines with B-Splines, and bars. It has multi-lined title, legend, automatic y-axis, and supports multiple series. It also can produce a monochrome version of the graph using monochromatic brushes. Those features are sufficient for my programming needs.
1310
1411I learned a lot from creating this component. I learned the algorithm to pick axis value range that are aligned to zero from an arbitrary set of values. I also learned some linear interpolation algoritms, although currently only B-splines that is accomodated in this component. And finally I understand why there's only a handful chart component out there.
1512
1613## Version History
1714
1815### Version 2.0
1916
20-Released: June 2023 - Ported to Lazarus, cross-platform - Some new properties: </tt>ShowXAxisLine</tt>, `ShowYAxisLine`, `GridColor`, `AxisLineWidth`, `TickLength`, `NiceSeries.LineWidth`
17+Released: June 2023 - Ported to Lazarus, cross-platform - Some new properties: ShowXAxisLine, `ShowYAxisLine`, `GridColor`, `AxisLineWidth`, `TickLength`, `NiceSeries.LineWidth`
2118
2219### Version 1.1
2320
2421Released: January 12nd, 2008 - bug fixed: title not centered - bug fixed: empty series - soft colors
2522
2623### Version 1.0
2724
2825Released: May 26th, 2007 - Initial release
2926
3027## License
3128
3229This library is released under Mozilla Public License. You can use it in your freeware, shareware or commercial softwares. You can send your modification to me, and if I decide to include it in the main distribution, I will add your name as a contributor. You can read full licensing information in the file "License.txt" in the NiceChart installation folder.
3330
3431## Download and installation
3532
3633The easiest way for Lazarus users is to get the package from the [[Online Package Manager]] (OPM) which is installed with newer Lazarus versions. Simply open its menu item, check "NiceChart" in the tree list, and click "Install". Then OPM will take care of the download and the installation.
3734
3835Since the OPM version may not always be up-to-date, you can also download the development version from the "Lazarus Component and Code Repository" (CCR) where a zipped snapshot is provided (https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/nicechart/). Alternatively, if you use SVN you can use the following SVN command in a console window:
3936
4037svn checkout <svn://svn.code.sf.net/p/lazarus-ccr/svn/components/nicechart> nicechart
4138
4239This applies also for Delphi users.
4340
4441In **Lazarus**, open the *NiceChartLaz.lpk* file in the package editor ("Package" \> "Open Package File (.lpk)"), click "Use" \> "Install", and let the IDE recompile itself.
4542
4643In **Delphi**, open *NiceChartD7.dpk* in the IDE and press the "Install" button. Another package is provided in the download for newer Delphi versions, named *NiceChartXE11*; although tested under Delphi XE11 (Alexandria) it should work in other Delphi versions as well.
4744
4845If you switch between several Delphi versions it may be required to delete the `.res` file of your project.
4946
5047The component will appear on the **priyatna.org** component palette tab.
5148
5249## Documentation
5350
5451### Methods
5552
5653There are some main methods of the component:
5754
58-- <b>`procedure`</b>` BeginUpdate;`
55+- `procedure`` BeginUpdate;`
5956
6057
6158Call this method to prevent control updating its content. This is useful when you want to add bulky data to the chart. Don't forget to call \<bb\>EndUpdate\</bb\> when you are done supplying data.
6259
63-- <b>`procedure`</b>` EndUpdate;`
60+- `procedure`` EndUpdate;`
6461
6562
6663Call this method to reenable update. You must call `BeginUpdate` prior to call this method.
6764
68-- <b>`function`</b>` AddSeries(AKind: TSeriesKind): TNiceSeries;`
65+- `function`` AddSeries(AKind: TSeriesKind): TNiceSeries;`
6966
7067
7168Add a new series to the chart. A series can be a bar, line or smooth line type.
7269
73-- <b>`function`</b>` ClientToChart(`<b>`const`</b>` X, Y: Integer; `<b>`var`</b>` AX, AY: Double): Boolean;`
70+- `function`` ClientToChart(``const`` X, Y: Integer; ``var`` AX, AY: Double): Boolean;`
7471
7572
7673Call this function to get X-axis and Y-axis value from mouse position. The X and Y parameters are the mouse position, and the corresponding X-axis and Y-axis values are stored in AX and AY variables. This function returns `True` if the supplied mouse position is within the X-axis and Y-axis range. Otherwise, it returns False.
7774
78-- <b>`procedure`</b>` RemoveSeries(ASeries: TNiceSeries);`
75+- `procedure`` RemoveSeries(ASeries: TNiceSeries);`
7976
8077
8178Removes a series from the chart.
8279
83-- <b>`procedure`</b>` Clear;`
80+- `procedure`` Clear;`
8481
8582
8683Removes all series from the chart.
8784
88-- <b>`function`</b>` CreateMetafile: TMetafile;`
85+- `function`` CreateMetafile: TMetafile;`
8986
9087
9188Creates a metafile (WMF) from the chart. This function is useful when you want to save the content of the chart to a file. Not available in the Lazarus version.
9289
93-- <b>`procedure`</b>` CopyToClipboard;`
90+- `procedure`` CopyToClipboard;`
9491
9592
9693Copies the content of the chart to the clipboard. The content can be pasted in any application as a graphic image. Not available in Lazarus.
9794
9895### Properties
9996
10097These are the main properties of the component:
10198
102-- <b>`property`</b>` Series[Index: Integer]: TNiceSeries;`
99+- `property`` Series[Index: Integer]: TNiceSeries;`
103100
104101
105102A collection of series that is contained in the chart.
106103
107-- <b>`property`</b>` SeriesCount: Integer;`
104+- `property`` SeriesCount: Integer;`
108105
109106
110107Specifies how many series are in the chart.
111108
112-- <b>`property`</b>` ShowLegend: Boolean;`
109+- `property`` ShowLegend: Boolean;`
113110
114111
115112Shows or hides legend. Set to `True` to show the legend, or set to `False` to hide it.
116113
117-- <b>`property`</b>` ShowTitle: Boolean;`
114+- `property`` ShowTitle: Boolean;`
118115
119116
120117Shows or hides title. Set to `True` to show the title, or set to `False` to hide it.
121118
122-- <b>`property`</b>` ShowXGrid: Boolean;`
119+- `property`` ShowXGrid: Boolean;`
123120
124121
125122Shows or hides horizontal grid. Set to `True` to show the grid, or set to `False` to hide it.
126123
127-- <b>`property`</b>` ShowYGrid: Boolean;`
124+- `property`` ShowYGrid: Boolean;`
128125
129126
130127Shows or hides vertical grid. Set to `True` to show the grid, or set to `False` to hide it.
131128
132-- <b>`property`</b>` Title: string;`
129+- `property`` Title: string;`
133130
134131
135132Specifies title of the chart. You can use a multi-lined title separated by \#13 (carriage return).
136133
137-- <b>`property`</b>` TitleFont: TFont;`
134+- `property`` TitleFont: TFont;`
138135
139136
140137Specifies title font name, size, color and styles (bold, italic, underline or strike-out).
141138
142-- <b>`property`</b>` AxisXTitle: string;`
139+- `property`` AxisXTitle: string;`
143140
144141
145142Specifies horizontal axis title.
146143
147-- <b>`property`</b>` AxisYTitle: string;`
144+- `property`` AxisYTitle: string;`
148145
149146
150147Specifies vertical axis title.
151148
152-- <b>`property`</b>` AxisXOnePerValue: Boolean;`
149+- `property`` AxisXOnePerValue: Boolean;`
153150
154151
155152Forces the chart to treat each x-axis value as a different value, so all point or bar can be viewed even though they have same x value.
156153
157-- <b>`property`</b>` AxisXScale: Single;`
154+- `property`` AxisXScale: Single;`
158155
159156
160157You can scale the horizontal axis so it shows different values than the original data. This is useful, for example, if you want to supply the data in real values, but want to show the axis in thousands. In this case, simply set this property to `1000`.
161158
162-- <b>`property`</b>` AxisYScale: Single;`
159+- `property`` AxisYScale: Single;`
163160
164161
165162Same as the above, but this is for vertical axis.
166163
167-- <b>`property`</b>` Monochrome: Boolean;`
164+- `property`` Monochrome: Boolean;`
168165
169166
170167If set to `True`, the chart will be drawn in monochrome, using different brush pattern for bars. Otherwise, it will be drawn in color. Colors and brush patterns for each series are automatically choosen by the component.
171168
172169**New properties in v2.0**
173170
174-- <b>`property`</b>` AxisLineWidth: Integer;`
171+- `property`` AxisLineWidth: Integer;`
175172
176173
177174Width of the pen (in pixels) used to draw the labelled x and y axes at the bottom and left sides of the chart, respectively.
178175
179-- <b>`property`</b>` ShowXAxisLine: boolean;`
176+- `property`` ShowXAxisLine: boolean;`
180177
181178
182179If set to `true`, the logical x axis will be drawn as a horizontal line at `y=0`.
183180
184-- <b>`property`</b>` ShowYAxisLine: boolean;`
181+- `property`` ShowYAxisLine: boolean;`
185182
186183
187184If set to `true`, the logical y axis will be drawn as a vertical line at `x=0`.
188185
189-- <b>`property`</b>` GridColor: TColor;`
186+- `property`` GridColor: TColor;`
190187
191188
192189Color of the grid lines.
193190
194-- <b>`property`</b>` TrickLength: Integer;`
191+- `property`` TrickLength: Integer;`
195192
196193
197194Length of the labelled tick marks at the chart axes.
198195
199196## Contacts
200197
201198Don't hesitate to report any bug or whish to me:
202199
203200Priyatna Bandung - Indonesia
204201
205202<http://www.priyatna.org/>
206203
207204[mailto:me@priyatna.org](mailto:me@priyatna.org)
208205
209206> **Note:** The http address is no longer available. You may report bugs also in the Lazarus bug tracker for the CCR project.
210207
211208---
212209*From the Free Pascal wiki, page "NiceChart", as it stood on 2023-06-25 after a change by Wp, 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).*

Back to history