Recent

Author Topic: TAchart: Multiple Axes  (Read 13480 times)

wp

  • Hero Member
  • *****
  • Posts: 11915
Re: TAchart: Multiple Axes
« Reply #15 on: March 19, 2012, 09:43:05 am »
Thank you. I really appreciate your work.

Attached is a new screen shot (created using svn), it is almost perfect. I restricted the Marks.Range to draw Marks only for values > 0, and for the pressure axis only for values < 2000, but the minor ticks are still there because there is no Marks.Range property for minors. But I think this is not the problem. Can it be that something is wrong with finding the first and last mark in case of the paned view? As you can see in the previous posting, marks finding is correct for the non-paned view.

Quote
Some design decisions are needed here.
Do you think axis should be drawn along the axis range, marks range, marks range + some constant?
Should the user be able to control the above choice?
How should it interact with arrows?
Well, I was thinking of the marks range, maybe with some constant. I did not use the arrows so far, but they would look best if they were at the end of the drawn axis.

BTW: What is the axis property Attachment for?

Ask

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 687
Re: TAchart: Multiple Axes
« Reply #16 on: March 19, 2012, 01:27:15 pm »
Quote
minor ticks are still there
Should be fixed in r36164-36165

Quote
What is the axis property Attachment for?

It is inherited from TChartMarks:
http://wiki.lazarus.freepascal.org/TAChart_documentation#Mark_positions_and_attachment.

Mostly useless for axis titles -- maybe except for the case when you want
the title to be drawn directly over the axis.

wp

  • Hero Member
  • *****
  • Posts: 11915
Re: TAchart: Multiple Axes
« Reply #17 on: March 19, 2012, 04:01:24 pm »
Fine! Thank you.

With another data file I am getting a new issue with marks positioning. As you can see in the attached screen shot the marks for the pressure axis are drawn only up to 40 although the data go up to 60.

I set up a simple demo project which shows the same effect. The red axis in this demo is for two overlaid (red) sine curves, the one with amplitude 1, the other one with amplitude 2. Marks, however, are drawn only for the curve with amplitude 1.

If the Marks property AtDataOnly is set as in this example, it seems to me that selection of marks seems to consider only the first series attached to an axis.

Ask

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 687
Re: TAchart: Multiple Axes
« Reply #18 on: March 20, 2012, 04:03:21 pm »
Quote
If the Marks property AtDataOnly is set as in this example, it seems to me that selection of marks seems to consider only the first series attached to an axis.

Indeed. This is because when implementing it I was unsure how to
process this case.

There are two possibilities:
1) Prepare axis marks for each series separately.
This would be useful for if the series data are spatially separated from each other.
2) Calculate a union of value ranges for all series, then generate marks for that range. This is preferable for overlapping series.

Since I do not use AtDataOnly myself, I postponed the decision
until I get some feedback.
You are the first user of this feature, so you get to decide ;)

wp

  • Hero Member
  • *****
  • Posts: 11915
Re: TAchart: Multiple Axes
« Reply #19 on: March 20, 2012, 05:56:33 pm »
Quote
You are the first user of this feature, so you get to decide
I feel honored...

When reading your answer I got the feeling that using AtDataOnly is maybe the wrong way. I modified the demo, let AtDataOnly at false but used the Range property to restrict the label range. I had been confused about the units of the range parameter, but it seems to be in "world" coordinates. Now the demo runs as I want it, see the attached screen shot.

If you still want to modify the behavior of AtDataOnly, I'd prefer the second option because I think it is more general.

 

TinyPortal © 2005-2018