Recent

Author Topic: Axises and Panes  (Read 7469 times)

kapibara

  • Hero Member
  • *****
  • Posts: 516
Axises and Panes
« on: July 20, 2013, 06:06:22 am »
The PANES demo has exactly what I need: separate left-axises for series in their own panes.

But when I try to create a copy of the PANES demo from scratch, all three axises in the demo is painted over each other and fills the whole chart. It is probably just a small setting but now I have spent several hours looking for it, so I must ask. I've attached my simple demo, can someone see why there is not three left axises looking like the TAChart panes demo?

Lazarus trunk / fpc 3.0.4 / Debian 10 - 64 bit

wp

  • Hero Member
  • *****
  • Posts: 6362
Re: Axises and Panes
« Reply #1 on: July 22, 2013, 10:08:11 am »
A hint for debugging this issue: ungroup the y axes by temporarily resetting their GroupIndex to 0. Then you'll see that the transformations are drawn properly. The only problem is that the marks of each label are drawn into the range of the other axes.

The parameter to restrict marks to a certain range is the Marks.Range property of each axis. Since your data extend between 0 and 50 for each data set, you simply set Marks.Range.Max = 50 (Marks.Range.Min = 0 is set by default) and activate Marks.Range.UseMin and Marks.Range.UseMax by assigning them to true.

If you should consider adding an individual title to each axis you should set Title.PositionOnMarks=true in order to roughly center the axis with respect to the data (otherwise, all titles would overlap in the center of the axis). And you should set the Title.Orientation of the new left axes to 900 to rotate the title by 90 degrees.

In the attachment you find a screen shot after these modifications of your demo.

Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

kapibara

  • Hero Member
  • *****
  • Posts: 516
Re: Axises and Panes
« Reply #2 on: July 24, 2013, 06:37:37 pm »
Thank you very much, wp. It works like a charm now.

For my own use I documented a step-by-step tutorial how to create the demo. Maybe it could accompany the demo?

Lazarus trunk / fpc 3.0.4 / Debian 10 - 64 bit

wp

  • Hero Member
  • *****
  • Posts: 6362
Re: Axises and Panes
« Reply #3 on: July 24, 2013, 09:48:49 pm »
You could write a tutorial for the wiki, see http://wiki.lazarus.freepascal.org/TAChart_Tutorial:_Getting_started as an example. Create an account from the link at the top of any wiki page to get write access. http://wiki.lazarus.freepascal.org/Help:Editing is an introduction to the wiki syntax.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

kapibara

  • Hero Member
  • *****
  • Posts: 516
Re: Axises and Panes
« Reply #4 on: August 29, 2013, 05:51:33 am »
Good idea! Here's my first wiki contribution:

http://wiki.freepascal.org/TAChart_Tutorial:_Multiple_Panes_in_one_Chart

Hope I put it in the right place.

You could write a tutorial for the wiki, see http://wiki.lazarus.freepascal.org/TAChart_Tutorial:_Getting_started as an example. Create an account from the link at the top of any wiki page to get write access. http://wiki.lazarus.freepascal.org/Help:Editing is an introduction to the wiki syntax.
Lazarus trunk / fpc 3.0.4 / Debian 10 - 64 bit

wp

  • Hero Member
  • *****
  • Posts: 6362
Re: Axises and Panes
« Reply #5 on: August 29, 2013, 09:44:28 am »
Thank you. Just one comment: The Panes demo belongs to TAChart, it is found in the folder (Lazarus)\components\tachart\demo\panes.Therefore, there is no need to link to an external page, just mention the location of the folder in the Lazarus directory structure.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1249
Re: Axises and Panes
« Reply #6 on: August 29, 2013, 01:55:07 pm »
Lazarus Trunk/FPC Trunk on Windows [7, 10]
  Have you tried searching this forum or the wiki?:   http://wiki.lazarus.freepascal.org/Alternative_Main_Page
  BOOKS! (Free and otherwise): http://wiki.lazarus.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines

wp

  • Hero Member
  • *****
  • Posts: 6362
Re: Axises and Panes
« Reply #7 on: August 29, 2013, 06:09:03 pm »
Changed the tutorial at a few places:
  • Removed link to external sources, modified source to match the tutorial text, appended these sources directly to tutorial
  • Replaced the screen shot by one which is directly taken from the tutorial project
  • Added explanatory notes why an AutoScaleTransformation is used etc.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

kapibara

  • Hero Member
  • *****
  • Posts: 516
Re: Axises and Panes
« Reply #8 on: August 29, 2013, 07:05:37 pm »
Ah, yes thats right.

Thank you. Just one comment: The Panes demo belongs to TAChart, it is found in the folder (Lazarus)\components\tachart\demo\panes.Therefore, there is no need to link to an external page, just mention the location of the folder in the Lazarus directory structure.
Lazarus trunk / fpc 3.0.4 / Debian 10 - 64 bit

kapibara

  • Hero Member
  • *****
  • Posts: 516
Re: Axises and Panes
« Reply #9 on: August 29, 2013, 07:30:18 pm »
Good, especially about the AutoScaleTransformations.

Changed the tutorial at a few places:
  • Removed link to external sources, modified source to match the tutorial text, appended these sources directly to tutorial
  • Replaced the screen shot by one which is directly taken from the tutorial project
  • Added explanatory notes why an AutoScaleTransformation is used etc.
Lazarus trunk / fpc 3.0.4 / Debian 10 - 64 bit

wp

  • Hero Member
  • *****
  • Posts: 6362
Re: Axises and Panes
« Reply #10 on: September 02, 2013, 06:04:25 pm »
Added some instructions on how to create axis titles for each pane to the tutorial. Moreover, I added a sketch to further explain the mapping procedure done by the AutoScaleAxisTransforms.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

ccrause

  • Full Member
  • ***
  • Posts: 185
Re: Axises and Panes
« Reply #11 on: December 24, 2013, 11:53:34 am »
Good idea! Here's my first wiki contribution:

http://wiki.freepascal.org/TAChart_Tutorial:_Multiple_Panes_in_one_Chart

Excellent tutorial, well done kapibara & WP!