Re: [Lazarus] TAChart - Logarithmic Transform fails for X Axis

2013-12-13 Thread Peter Thurner


Hello again,

I changed now from Lazarus 64 Bit to 32 Bit version and there it works 
as expected.

BR Peter


Am 13.12.2013 22:18, schrieb Peter Thurner:

Hello *,

here is an example which I use to try log transform for x-axis:
Can anybody try out please the code below which plots a sin(x)/x curve 
between 1 ... 100 in linear scale.

(please see attached picture).

If I apply a log10 transform to the x axis, then I always get a Range 
Check Error!

What do I do wrong here?
Thanks in advance for your help.

===
unit Unit1;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, TAGraph, TATransformations, TASeries,
  TAFuncSeries, TAIntervalSources, Forms, Controls, Graphics, Dialogs;

type

  { TForm1 }

  TForm1 = class(TForm)
Chart1: TChart;
ChartAxisTransformations1: TChartAxisTransformations;
LogarithmAxis: TLogarithmAxisTransform;
SincSeries: TLineSeries;
procedure FormCreate(Sender: TObject);
  private
{ private declarations }
  public
{ public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.lfm}

{ TForm1 }

procedure TForm1.FormCreate(Sender: TObject);
const
  N = 1000;
  MIN = 0.1;
  MAX = 100;
var
  i: integer;
  x: double;
begin
  for i := 0 to N - 1 do
  begin
x := MIN + (MAX - MIN) * i / (N - 1);
SincSeries.AddXY(x, sin(x)/x);
  end;
end;

end.
===


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TAChart - Logarithmic Transform fails for X Axis

2013-12-09 Thread Peter Thurner

Hello Salvatore,
Thanks for the reply.
Yes, I used the same dataset and switched x and y. It worked when I did 
log transform with left-axis.

the same dataset fails if I switch x and y and do transform on bottom axis.
BR Peter


Am 08.12.2013 18:44, schrieb Salvatore Coppola:

Have you checked data (0)?
Salvatore


2013/12/7 Peter Thurner pm.thur...@gmx.at mailto:pm.thur...@gmx.at

Hello *,

This is the first time that I post something, so please be patient
with me :-)

I have been using Plotpanel now for a while to plot Bode diagrams
within Lazarus GUIs.
Now I would like to switch to TAChart which seems very powerfull too.
I tried it out with linear graphs and it works very well.

But If I try to plot a bode diagram with a logarithmic x Axis then
it crashes.
I followed the tutorial about logarithmic transform:

http://wiki.freepascal.org/TAChart_Tutorial:_ListChartSource,_Logarithmic_Axis,_Fitting
and I did all the steps successfully.

BUT If I try to apply a logarithmic transform to the bottom axis
(x-axis) then it crashes.
It displays the graph but the grid lines are gone.
Has anybody tried already to apply log transform to bottom axis?
It works for left axis.

Thanks
PeterT

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
mailto:Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus




--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] TAChart - Logarithmic Transform fails for X Axis

2013-12-07 Thread Peter Thurner

Hello *,

This is the first time that I post something, so please be patient with 
me :-)


I have been using Plotpanel now for a while to plot Bode diagrams within 
Lazarus GUIs.

Now I would like to switch to TAChart which seems very powerfull too.
I tried it out with linear graphs and it works very well.

But If I try to plot a bode diagram with a logarithmic x Axis then it 
crashes.

I followed the tutorial about logarithmic transform:
http://wiki.freepascal.org/TAChart_Tutorial:_ListChartSource,_Logarithmic_Axis,_Fitting
and I did all the steps successfully.

BUT If I try to apply a logarithmic transform to the bottom axis 
(x-axis) then it crashes.

It displays the graph but the grid lines are gone.
Has anybody tried already to apply log transform to bottom axis? It 
works for left axis.


Thanks
PeterT

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus