Sign in Join
Wiki copytemporary

TAChart Tutorial: ListChartSource, Logarithmic Axis, Fitting: what changed

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

OldNewLine
11## Introduction
22
33![](/wiki-images/3/3d/TAChart_LogAx_Tutorial15.png)
44
55Do you know [Moore's law](https://en.wikipedia.org/wiki/Moore's_law)? It is in front of you...
66
77When you are reading this you are probably sitting in front of your desktop computer or have your notebook on your knees, or you are holding your smartphone in your hand. A tremendous progress of microtechnology has been happening during the last decades and is still on-going. This is due to miniaturization of electronic devices allowing to pack ever more functions onto a single silicon chip. And this is what Moore's law is about: the number of transistors on a chip has doubled approximately every two years.
88
99In this tutorial we will take published data of an important manufacturer of microprocessors and use TAChart to plot the number of transistors versus the year of market introduction of the products. From these data we will try to confirm Moore's law.
1010
1111You can find the data on the site [www.intel.com/pressroom/kits/quickreffam.htm](http://www.intel.com/pressroom/kits/quickreffam.htm) which contains a list of microprocessors, their date of market introduction, and their transistor count per chip.
1212
1313When working through this example you will learn
1414
1515- how to **enter data at designtime**
1616- how to create a **point series with marks above each data point**
1717- how to **create a logarithmic axis**
1818- how to **fit an equation to data**.
1919
2020You should have some basic knowledge of how to work with TAChart; if you don't you should have a look at the [[TAChart Tutorial: Getting started|Getting started tutorial]] of TAChart. Of course, you must be familiar with [[Lazarus]] and [[Object Pascal]]. And you should not be too afraid of math, you'll need logarithms and the exponential function.
2121
2222## Preparation
2323
2424### Setting up the chart
2525
2626- Create a new project.
2727- Since we will get some long axis labels increase the size of the form to something like 540 x 320 pixels.
2828- Add a `TChart` component, align it to `alClient`, set its `BackColor` to `clWhite` and the `Grid.Color` of each axis to `clSilver`.
2929- Add a title to the x axis ("Year of market introduction") and to the y axis ("Number of transistors").
3030- Use the text "Progress in Microelectronics" as the chart's title.
3131- Set these font styles to `fsBold`.
3232- Show a reference for our data in the footer. Use the chart's property [[TAChart documentation|Foot]] for that. Note that the property editor of `Foot.Text` (as well as that of `Title.Text`) allows to enter multi-lined titles.
3333
3434![](/wiki-images/1/17/TAChart_LogAx_Tutorial1.png)
3535
3636### Creating a point series
3737
3838We want to draw each TDataRecord as a single data point - this is called "point series" in other charting programs. The TAChart series editor does not offer this type of series because [[TAChart documentation|TLineSeries]] can do this as well. We only have to set its property `ShowPoints` to `true` and to turn off the connecting lines (`LineType` = `ltNone`). The symbols are determined by the property `Pointer`.
3939
4040So, add a LineSeries to the form and set the properties to create a point series. Additionally, let's set the `Pointer.Brush.Color` to `clRed`, and the `Pointer.Style` to `psCircle` to draw a red circle at each data point.
4141
4242## Entering data
4343
4444### ListChartSource
4545
4646There are many ways that data could be entered into the chart. We will use a [[TAChart documentation|ListChartSource]] today. Usually data are loaded into this source dynamically at run-time, for example after reading a file. In our project, however, we want to enter them at design-time by means of the data point editor of the ListChartSource. This has the main advantage that all our changes that we do with the chart are displayed immediately, there is no need to compile the project. As you will see, however, there are some drawbacks as well.
4747
4848The ListChartSource stores the data to be plotted in a list - that's where its name comes from. The list items are so-called `TChartDataItem` objects containing for each data point:
4949
5050- the `x` and `y` coordinates,
5151- a `Text` to be used for data marks,
5252- a `Color` that overrides the SeriesColor,
5353- as well as a `YList` which contains additional y values which are needed in some specialized series types.
5454
5555The ListChartSource is the same type of chart source that is used by many series classes internally. Having it as a separate component, however, has the big advantage that the same chart source can be used again for other series - we will need this feature later when applying the FitSeries.
5656
5757![](/wiki-images/3/3b/TAChart_LogAx_Tutorial2.png) We start by adding a TListChartSource to our form. This is the second icon in the chart component palette. Connect the series to this chart source by pointing its property `Source` to the new `ListChartSource1`.
5858
5959### The ListChartSource data points editor
6060
6161![](/wiki-images/a/af/TAChart_LogAx_Tutorial16.png)
6262
6363Clicking at the ellipsis button next to the property `DataPoints` opens the datapoints editor of the chart source. This is a string grid into which you can enter the data. Type in the data from the preceding image. They are an excerpt from the web site mentioned in the introduction. This site shows the time of market introduction by year and month - for simplicity, I skipped the month and rounded to the nearest calendar year. Enter the years into column **X**. Column **Y** will get the number of transistors per chip. The name of each microprocessor will go into column **Text**. Since we do not want to give each data point an individual color we leave the column **Color** alone - but, of course, you can experiment with that feature.
6464
6565When you close the datapoints editor the series is automatically updated and displays the current data set. Wow!
6666
6767### Displaying datapoint marks
6868
6969Why don't we see the processor names that we entered in the grid? [[TAChart documentation|Data point marks]] are turned off by default. Select the series and go to `Marks`. Look at the subproperty `Style`, it is `smsNone` which means "off". Open the dropdown list. You will see a variety of options how the data points can be labeled. Play with these settings to learn what they mean. Here we want to use `smsLabel` which displays the `Text` field of the `TChartDataItem`. In order to assign **Marks.Style** through source code, `uses ... TAChartUtils` shall be added.
7070
7171There is also a connecting line between the label and the datapoint. Its color is white by default, that's why we cannot see it on the white background. The property name for this line is `LinkPen`. You may want to set the `LinkPen.Color` to `clGray`.
7272
7373The position of the marks is OK here, but you should know that the series has a property [[TAChart documentation|MarkPositions]] to control positioning to some degree.
7474
7575![](/wiki-images/a/a4/TAChart_LogAx_Tutorial3.png)
7676
7777Maybe we compile the project at this time.
7878
7979There is nothing new - we saw everything already at design-time. This is a great advantage of working with the datapoints editor of a ListChartSource.
8080
8181There are two things which can be improved at this stage:
8282
8383- The point labels are cut off at the edges of the chart. We can fix this by increasing the chart's `Margin.Left` and `Margin.Right` to 24. [[TAChart documentation|Margin]] defines the space surrounding the inner plot area to keep it free from data points. There is also a property [[TAChart documentation|MarginExternal]] which surrounds the outer border of the chart and can be used to change the distance to neighboring controls.
8484- Since almost all data points are crowded at the bottom of the chart the plot is not very meaningful. This is why we need a **logarithmic axis**.
8585
8686## Setting up a logarithmic axis
8787
8888Plotting data on a logarithmic axis means that the logarithms of the data values are plotted, not the values directly. The y values in our diagram, for example, range between 2300 and 731 million. When we calculate the ([decadic](https://en.wikipedia.org/wiki/Common_logarithm)/log<sub>10</sub>) logarithms, the range is only between about 3.3 and 7.1 - in such a diagram the data can be distinguished much easier.
8989
9090### TChartTransformations and LogarithmicAxisTransform
9191
9292![](/wiki-images/3/36/TAChart_LogAx_Tutorial4.png) Calculating the logarithm can be done by TAChart automatically. The main advantage is that the original data units are drawn on the axis while the logarithms are used for plotting.
9393
9494In fact, there is an entire group of components for axis transformations: [[TAChart documentation|TChartAxisTransformations]]. An axis transformation is a function which maps "real world" data in units as displayed on the axis (*"axis coordinates"*) to internal units that are common to all series in the same chart (*"graph coordinates"*). The axis coordinate of the transistor count of the 4004 processor, for example, is 2300, the graph coordinate is the logarithm of that number, i.e. log<sub>10</sub>(2300) = 3.36.
9595
9696TAChart provides a variety of transforms. In addition to the logarithm transform, there is a [[TAChart documentation|linear transform]] which allows to multiply the data by a factor and to add an offset. The [[TAChart documentation|auto-scaling transform]] is useful when several independently scaled series have to be drawn on the same axis. The [[TAChart documentation|user-defined transform]] allows to apply any arbitrary transformation.
9797
9898![](/wiki-images/5/55/TAChart_LogAx_Tutorial5.png)
9999
100100Add a `TAChartTransformations` component to the form, double-click on it (or right-click on it in the object tree and select "Edit axis transformations"), click on "Add" and select "Logarithmic". This will create a `ChartAxisTransformations1LogarithmAxisTransform1` component - what a name! Anyway, there's a high chance that you will not have to type it...
101101
102102In the object inspector, you will see only a few properties - the most important one is `Base`. This is the base of the logarithm to be calculated. Change it to 10, since we want to calculate the [decadic logarithms](https://en.wikipedia.org/wiki/Common_logarithm) - this case comprises 99% of all logarithmic charts.
103103
104104A side-note: it is very important that you **save the project at this time**. Why? You will see in a minute...
105105
106106Now we must identify the axis which is to be transformed. For this purpose each axis has a property `Transformations`. In our case, the huge numbers are plotted on the y axis. So, go to the left axis and set its property `Transformations` to `ChartAxisTransformations1`.
107107
108108![](/wiki-images/0/0d/TAChart_LogAx_Tutorial17.png)
109109
110110Oh - what's that? An error message pops up reporting a range check error. Hopefully you had saved the project. If you click on Cancel Lazarus will shut down, everything will be lost. If you click on OK suddenly the chart is gone, it reappears when you click somewhere, but the faulty axis is hidden ...
111111
112112Are you getting desperate?
113113
114114This is the main disadvantage of working at design-time. If something goes wrong, there is no debugger, no indication of what caused the trouble. Since components are compiled into Lazarus you would have to debug the IDE. Sounds complicated...
115115
116116Let's sit down and think what we did. We assigned the logarithmic transform to the y axis. The transform does not yet have any connection to the data, therefore the data are still in "real" units, their maximum is 731 million. But the transform "thinks" that the data are already in graph units (logarithms). When it calculates the axis labels in axis units it takes hundreds of millions to the power of 10! That's what causes the range check error. However, the situation is not always so dramatic; the least thing that could happen is that the data are not transformed, but the axis is.
117117
118118What can we do against that? Each series has properties `AxisIndexX` and `AxisIndexY`. The transform can use this information to calculate the logarithms of the correct coordinates before the axis labels are updated. This solves our problem.
119119
120120So, click on Cancel to shutdown Lazarus. Restart and reload the project. In the saved state, the transformation is not yet connected to the axis.
121121
122122Now have a look at the object tree above the object inspector and you will see that the left axis has index 0. So set the series' `AxisIndexY` to this value. Although not necessary it may be a good idea to disarm also the x axis by assigning its index 1 to the `AxisIndexX` of the series - who can guarantee that we won't transform the x axis in the future?
123123
124124After this is done you can set the `LeftAxis.Transformation` to `ChartTransformations1` without the range check error.
125125
126126With the logarithm transform activated the data points spread nicely across the y axis range now. But what's wrong with the y axis labels? And the years on the x axis are too close and partly overlap.
127127
128128![](/wiki-images/d/d0/TAChart_LogAx_Tutorial6.png)
129129
130130Finding axis labels is a non-trivial task, in particular when transformations are active that heavily distort the axis intervals. Unfortunately, logarithmic axes belong to that group. Basically, there are two ways to control label positioning, an **automatic** and a **manual** way.
131131
132132### Automatic finding of axis labels
133133
134134For automatic label positioning, each axis has a property [[TAChart documentation|Intervals]] which gives access to several, partly mutually excluding parameters - please see [[TAChart documentation]] for an explanation. In case of the logarithmic axis the issue is usually caused by the fact that the option `aipGraphCoordinates` is not set. This option, if set, enforces calculation of the tick intervals for the transformed data ("graph coordinates"), not the "real world" data ("axis coordinates"). So, set `aipGraphCoordinates` in the `LeftAxis.Intervals.Options`. The labels jump to more evenly distributed locations.
135135
136136![](/wiki-images/f/f1/TAChart_LogAx_Tutorial7.png)
137137
138138Depending on the size of your form you may get quite nice, or not so good labels. If you resize the form you will see some "crooked" labels jump in.
139139
140140You can improve the quality of label presentation in the following way:
141141
142142- Increase the `Intervals.Tolerance`. This allows for varying spacing between tick marks.
143143- Adjust the range, in pixels, in which the label distance can vary. This is defined by the properties `Intervals.MaxLength` and `Intervals.MinLength`. The optimum value depends on the size of the chart and on the range of the data. In our example project, good labels are obtained by setting these properties to 100 and 50, respectively. Usually `Intervals.MaxLength` provides better results.
144144
145145In the same way, the overlapping year labels of the x axis can be addressed. Just increase the `BottomAxis.Intervals.MaxLength` to 70.
146146
147147What is left now is the "1" that appears at the y axis between "10000000" and "1E009". This is due to a bug in some FPC versions. If you have that as well, simply change the property `LeftAxis.Marks.Format`. This string is passed to the `Format` function to convert the numbers to strings. The format specifier "%0.0n" for example avoids that conversion error and, additionally, adds nice thousand separators to the labels which makes them much more readable.
148148
149149![](/wiki-images/7/7e/TAChart_LogAx_Tutorial8.png)
150150
151151### Manual finding of axis labels
152152
153153This is the best we can do with automatic label positioning. It is not perfect because when we increase the height of the window, or zoom in, the half-decade values may appear, or the label interval may be two decades as in above figure.
154154
155155If you are not happy with that you have to use **manual axis label selection**. For this purpose, each axis has a property `Source` which can be linked to a ListChartSource containing only the allowed axes labels. So when this chart source contains only full-decade labels there is no risk of half-decade labels or omitting every other label. On the other hand, when you zoom into the chart you may come to a point where no labels are visible any more.
156156
157157Add a second ListChartSource to the form. You can use the DataPoints editor again to enter the full-decade numbers. This has the advantage that you can complete most of this project without writing a single line of code!
158158
159159But you could also populate the listsource easily in the `FormCreate` event:
160160
161161``` pascal
162162procedure TForm1.FormCreate(Sender: TObject);
163163const
164164 MIN = 0;
165165 MAX = 12;
166166var
167167 i: Integer;
168168 value: double;
169169begin
170170 for i:=MIN to MAX do begin
171171 value := Power(10, i);
172172 ListChartSource2.Add(value, value);
173173 end;
174174end;
175175```
176176
177177This procedure adds powers of 10 in a wide enough range to the ListChartSource by means of its method `Add`.
178178
179179Connect `ListChartSource1` to `LeftAxis.Marks.Source` to activate the manual labels of the ListChartSource. You should also remove all flags from the `Options` property. Otherwise automatic tick finding will still be active to some degree. If you did not use the DataPoints editor you must compile to see the effect.
180180
181181![](/wiki-images/5/51/TAChart_LogAx_Tutorial9.png)
182182
183183### Minor tick marks
184184
185185Very often minor tick marks are placed between the major tick marks. TAChart allows to add several sets of minor ticks to each axis. We only need one here. Go to `LeftAxis` and click on the ellipsis button next to the property `Minors`. This opens the editor for `Chart1.AxisList[0].Minors`. Click on "Add" and on the "M" in the list below. Now you can adjust the parameters in the object inspector to get "good" minor ticks. If the major ticks on a logarithmic axis are at full decades then the minor ticks usually are at 2, 3, 4,..., 8, 9, and, of course, powers of 10. This can be achieved easily by turning off all `Intervals.Options` except for `aipUseCount` and setting `Intervals.Count = 9`. Of course, this makes sense only when the major labels are fixed at full decades like in the manual approach above.
186186
187187Usually the plot gets too crowded by the minor grid which appears now, you should set the minor's `Grid.Visible` to `false`.
188188
189189![](/wiki-images/5/5c/TAChart_LogAx_Tutorial10.png)
190190
191191## Fitting
192192
193193Now let's look for a relation between the data, i.e. we want to find a mathematical formula which describes the dependence of transistor count on market introduction year. This is called "fitting": we select a formula with parameters and adjust the parameters such that the deviation to the data is as small as possible.
194194
195195TAChart does not contain a full-fledged fitting engine. It uses the fitting routines from the FPC numerical library [[numlib]]. Therefore, TAChart cannot address all variants of fitting, but it covers the most important case, fitting of a [polynomial](https://en.wikipedia.org/wiki/Polynomial) by means of the [linear least squares technique](https://en.wikipedia.org/wiki/Least_squares). This is about the level available to Excel users when they add a "trend line" to their chart.
196196
197197### TFitSeries
198198
199199TAChart provides a specialized [[TAChart documentation|TFitSeries]] for fitting. This series has a property `FitEquation` which defines the formula that is used:
200200
201201- `fePolynomial`: y = b<sub>0</sub> + b<sub>1</sub>x + b<sub>2</sub>x<sup>2</sup> + … + b<sub>n</sub>x<sup>n</sup>. Specify the number of fitting parameters a<sub>i</sub> by the property `ParamCount` = n + 1.
202202- `feLinear`: y = a + bx -- this is a special case of the general polynomial with n = 1 and fitting parameters a and b. It is made available as a separate item because straight lines define the most important fitting conditions.
203203- `feExp`: y = a * e<sup>bx</sup> -- This equation can also be reduced to the polynomial case although this is not straightforward to see. But take the (natural) logarithm of this equation, and you get to ln(y) = a + bx. Now when we fit ln(y) instead of y we have the linear case again.
204204- `fePower`: y = a * x<sup>b</sup>. Again, this can be reduced to a linear equation by a logarithmic transformation.
205205
206206![](/wiki-images/b/b5/TAChart_LogAx_Tutorial11.png)
207207
208208Enough of theory. Let's add a FitSeries to the chart: double-click on the chart, and in the series editor click on "Add" and select the entry "Least squares fit series" from the dropdown list.
209209
210210At first, we need to tell the fit series where it finds its data. For this purpose, we connect the series' `Source` with `ListChartSource1` as we had done with the line series. You see: the same chart source can be used for several series.
211211
212212You hopefully remember the disaster above with the AxisIndex. So, set the `AxisIndexY` to the index of the left axis as we did with the line series.
213213
214214Which one of the four `FitEquation` possibilities do we select? Well, the data look like lying on a straight line. So let's select `feLinear`.
215215
216216![](/wiki-images/0/06/TAChart_LogAx_Tutorial12.png)
217217
218218Oops... We see the black fitted curve, but it does not "fit" at all. And we wanted a straight line, but we get a twisted curve. How can this be?
219219
220220The reason is the logarithmic transform that we applied to the y data. Therefore, our plot shows the logarithms, but the fit takes the "raw" data. We are effectively fitting the straight line to the data in the screenshot in the section Displaying datapoint marks where the log transform had not yet been introduced - it is clear that the line would not "fit" there. And when the fitted function is drawn the log transform distorts the straight line to the twisted curve that we see.
221221
222222On the other hand, if the **log data** follow a straight line our fitting law is not linear, but exponential. Let's set `FitEquation` to `feExp` and try again.
223223
224224![](/wiki-images/a/ac/TAChart_LogAx_Tutorial13.png)
225225
226226Ah - much better!
227227
228228Now we know that the exponential law, y = a * x<sup>b</sup>, is a good description of our data. But how do we get the fitting parameters a and b?
229229
230230### Fit results
231231
232232The fit series has a public array property `Param` which contains the fitting parameters. `a` is in `Params[0]`, and `b` is in `Params[1]`. Of course, these values are correct only when a valid fit has been performed. How do we know that? Well, the fit series provides an event `OnFitComplete` that is generated when the fit complete successfully. That's where we can evaluate the obtained fit parameters. As an example, let's display the fit results in a message along with the fit equation:
233233
234234``` pascal
235235procedure TForm1.Chart1FitSeries1FitComplete(Sender: TObject);
236236begin
237237 with Chart1FitSeries1 do
238238 ShowMessage(Format(
239239 'Fit result: a = %g, b = %g', [
240240 Param[0], Param[1]
241241 ]));
242242end;
243243```
244244
245245And that's what we get:
246246
247247![](/wiki-images/d/d1/TAChart_LogAx_Tutorial14.png)
248248
249249Now we want to calculate the time T until the number of transistors on a chip is doubled. As an exercise try to show that
250250
251-`T = ln(2) / b`
251+```text
252+T = ln(2) / b
253+```
252254
253255It would be nice to show the doubling time as an additional line of the chart title. For this, we modify the `OnFitComplete` event handler as follows:
254256
255257``` pascal
256258procedure TForm1.Chart1FitSeries1FitComplete(Sender: TObject);
257259begin
258260 Chart1.Title.Text.Add(Format(
259261 'The number of transistors doubles every %.0f years',
260262 [ln(2) / Chart1FitSeries1.Param[1]]
261263 ));
262264end;
263265```
264266
265267![](/wiki-images/3/3d/TAChart_LogAx_Tutorial15.png)
266268
267269Wow! This is Moore's law: "The number of transistors per chip doubles every two years"...
268270
269271## Source code
270272
271273### Project file
272274
273275``` pascal
274276program project1;
275277
276278{$mode objfpc}{$H+}
277279
278280uses
279281 {$IFDEF UNIX}{$IFDEF UseCThreads}
280282 cthreads,
281283 {$ENDIF}{$ENDIF}
282284 Interfaces, // this includes the LCL widgetset
283285 Forms, Unit1, tachartlazaruspkg
284286 { you can add units after this };
285287
286288{$R *.res}
287289
288290begin
289291 //RequireDerivedFormResource := True;
290292 Application.Initialize;
291293 Application.CreateForm(TForm1, Form1);
292294 Application.Run;
293295end.
294296```
295297
296298### Unit1.pas
297299
298300``` pascal
299301unit Unit1;
300302
301303{$mode objfpc}{$H+}
302304
303305interface
304306
305307uses
306308 Classes, SysUtils, FileUtil, TAGraph, TASeries, TASources, Forms, Controls,
307309 Graphics, Dialogs, TACustomSource, TATransformations, TAFuncSeries;
308310
309311type
310312
311313 { TForm1 }
312314
313315 TForm1 = class(TForm)
314316 Chart1: TChart;
315317 Chart1FitSeries1: TFitSeries;
316318 Chart1LineSeries1: TLineSeries;
317319 ChartAxisTransformations1: TChartAxisTransformations;
318320 ChartAxisTransformations1LogarithmAxisTransform1: TLogarithmAxisTransform;
319321 ListChartSource1: TListChartSource;
320322 ListChartSource2: TListChartSource;
321323 procedure Chart1FitSeries1FitComplete(Sender: TObject);
322324 procedure FormCreate(Sender: TObject);
323325 private
324326 { private declarations }
325327 public
326328 { public declarations }
327329 end;
328330
329331var
330332 Form1: TForm1;
331333
332334implementation
333335
334336{$R *.lfm}
335337
336338uses
337339 math;
338340
339341{ TForm1 }
340342
341343procedure TForm1.FormCreate(Sender: TObject);
342344const
343345 MIN = 0;
344346 MAX = 12;
345347var
346348 i: Integer;
347349 value: double;
348350begin
349351 for i:=MIN to MAX do begin
350352 value := IntPower(10, i);
351353 ListChartSource2.Add(value, value);
352354 end;
353355 Chart1FitSeries1.ExecFit;
354356end;
355357
356358procedure TForm1.Chart1FitSeries1FitComplete(Sender: TObject);
357359begin
358360 {
359361 with Chart1FitSeries1 do
360362 ShowMessage(Format(
361363 'Fit result: a = %g, b = %g', [
362364 Param[0], Param[1]
363365 ]));
364366 }
365367 Chart1.Title.Text.Add(Format(
366368 'The number of transistors doubles every %.0f years',
367369 [ln(2) / Chart1FitSeries1.Param[1]]
368370 ));
369371end;
370372
371373end.
372374```
373375
374376### Unit1.lfm
375377
376-``` pascal
378+``` lfm
377379object Form1: TForm1
378380 Left = 244
379381 Height = 356
380382 Top = 193
381383 Width = 552
382384 Caption = 'Form1'
383385 ClientHeight = 356
384386 ClientWidth = 552
385387 OnCreate = FormCreate
386388 LCLVersion = '1.1'
387389 object Chart1: TChart
388390 Left = 0
389391 Height = 356
390392 Top = 0
391393 Width = 552
392394 AxisList = <
393395 item
394396 Grid.Color = clSilver
395397 Marks.Format = '%0:.0n'
396398 Marks.Source = ListChartSource2
397399 Marks.Style = smsCustom
398400 Minors = <
399401 item
400402 Grid.Visible = False
401403 Intervals.Count = 9
402404 Intervals.MinLength = 5
403405 Intervals.Options = [aipUseCount]
404406 end>
405407 Title.LabelFont.Orientation = 900
406408 Title.LabelFont.Style = [fsBold]
407409 Title.Visible = True
408410 Title.Caption = 'Number of transistors'
409411 Transformations = ChartAxisTransformations1
410412 end
411413 item
412414 Grid.Color = clSilver
413415 Intervals.MaxLength = 60
414416 Alignment = calBottom
415417 Minors = <>
416418 Title.LabelFont.Style = [fsBold]
417419 Title.Visible = True
418420 Title.Caption = 'Year of market introduction'
419421 end>
420422 BackColor = clWhite
421423 Foot.Alignment = taLeftJustify
422424 Foot.Brush.Color = clBtnFace
423425 Foot.Font.Color = clBlue
424426 Foot.Text.Strings = (
425427 'Source:'
426428 'http://www.intel.com/pressroom/kits/quickreffam.htm'
427429 )
428430 Foot.Visible = True
429431 Margins.Left = 24
430432 Margins.Right = 24
431433 Title.Brush.Color = clBtnFace
432434 Title.Font.Color = clBlue
433435 Title.Font.Style = [fsBold]
434436 Title.Text.Strings = (
435437 'Progress in Microelectronics'
436438 )
437439 Title.Visible = True
438440 Align = alClient
439441 ParentColor = False
440442 object Chart1LineSeries1: TLineSeries
441443 Marks.Format = '%2:s'
442444 Marks.LinkPen.Color = clGray
443445 Marks.Style = smsLabel
444446 AxisIndexY = 0
445447 LineType = ltNone
446448 Pointer.Brush.Color = clRed
447449 Pointer.Style = psCircle
448450 ShowPoints = True
449451 Source = ListChartSource1
450452 end
451453 object Chart1FitSeries1: TFitSeries
452454 AxisIndexX = 1
453455 AxisIndexY = 0
454456 FitEquation = feExp
455457 OnFitComplete = Chart1FitSeries1FitComplete
456458 ParamCount = 2
457459 Source = ListChartSource1
458460 end
459461 end
460462 object ListChartSource1: TListChartSource
461463 DataPoints.Strings = (
462464 '1972|2300|?|4004'
463465 '1974|6000|?|8080'
464466 '1978|29000|?|8086'
465467 '1982|134000|?|80286'
466468 '1986|275000|?|80386'
467469 '1989|1200000|?|80486'
468470 '1993|3100000|?|Pentium'
469471 '1997|7500000|?|Pentium II'
470472 '2001|42000000|?|Xeon'
471473 '2006|152000000|?|Core Duo'
472474 '2009|731000000|?|Core i7'
473475 )
474476 left = 240
475477 top = 40
476478 end
477479 object ChartAxisTransformations1: TChartAxisTransformations
478480 left = 243
479481 top = 96
480482 object ChartAxisTransformations1LogarithmAxisTransform1: TLogarithmAxisTransform
481483 Base = 10
482484 end
483485 end
484486 object ListChartSource2: TListChartSource
485487 left = 243
486488 top = 176
487489 end
488490end
489491```
490492
491493---
492494*From the Free Pascal wiki, page "TAChart Tutorial: ListChartSource, Logarithmic Axis, Fitting", as it stood on 2020-02-29 after a change by Trev, 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